1

I have the following ASP.net Core 2.1 SOAP service (SoapCore)

    var host = WebHost.CreateDefaultBuilder()
        .ConfigureServices(services =>
            {
                services.Add(new ServiceDescriptor(typeof(IMyInterface), typeof(MyService), ServiceLifetime.Singleton));
                services.AddSoapCore();
            }).Configure(app =>
            {
                var binding = new BasicHttpBinding();
                app.UseSoapEndpoint<IMyInterface>("", binding);
            }).UseHttpSys(opt =>
        {
            opt.UrlPrefixes.Add("http://+:9002/MyService");
        }).Build();

I'm calling it from SoapUI, it works.

I try to switch it to HTTPS:

    var host = WebHost.CreateDefaultBuilder()
        .ConfigureServices(services =>
            {
                services.Add(new ServiceDescriptor(typeof(IMyInterface), typeof(MyService), ServiceLifetime.Singleton));
                services.AddSoapCore();
            }).Configure(app =>
            {
                var binding = new BasicHttpsBinding();
                app.UseSoapEndpoint<IMyInterface>("", binding);
            }).UseHttpSys(opt =>
        {
            opt.UrlPrefixes.Add("https://+:9002/MyService");
        }).Build();

It does not works. What am I doing wrong? Also tried to move the service name from the UrlPrefix to the Soap endpoint, same result. Wireshark shows that the conection is termiated without sending any byte back to the client.

It works when HTTP.sys is not used. This works:

    var host = WebHost.CreateDefaultBuilder()
        .ConfigureServices(services =>
            {
                services.Add(new ServiceDescriptor(typeof(IMyInterface), typeof(MyService), ServiceLifetime.Singleton));
                services.AddSoapCore();
            }).Configure(app =>
            {
                var binding = new BasicHttpsBinding();
                app.UseSoapEndpoint<IMyInterface>("/MyService", binding);
            }).UseUrls("https://+:9002").Build();

I need HTTP.sys because I have multiple services on the same port. I'm running the service as adminstrator (for testing)

zgabi
  • 404
  • 1
  • 4
  • 11

0 Answers0