I have simple structure in my web application.
Is there any chance to hide a wsdl source in url https://localhost:7189/Service.svc to keep it unvisible from users?
I tried to create web.config and enter there some settings which I found but this not gave me expected results.
Solution:
app.UseEndpoints(endpoints =>
{
endpoints.UseSoapEndpoint<BookService>(new Action<SoapCoreOptions>(CreateBookServiceEndpoint));
});
void CreateBookServiceEndpoint(SoapCoreOptions target)
{
target.HttpGetEnabled = false;
target.HttpsGetEnabled = false;
target.Path = "/BookService.svc";
target.EncoderOptions = new SoapEncoderOptions[] { new SoapEncoderOptions() };
target.SoapSerializer = SoapSerializer.XmlSerializer;
}
CodePudding user response:
Looks like you can't issue GET requests when HttpsGetEnabled
or HttpGetEnabled
are false (for HTTPS/HTTP requests respectively), so something like this:
.UseSoapEndpoint(..., options =>
{
HttpGetEnabled = false,
HttpsGetEnabled = false,
});