locked
ssl load balancer in the middel soap asmx webservice RRS feed

  • Question

  • User-1727801661 posted

    Hi,

    we use a simple soap webservice over http in our silverlight application, with a http call all works fine. One of our customer uses a load balancer in the middle with ssl. Our customer explained it as follows and so I understand that too, the incomming call is https://.../webservice.asmx and the load balancer forwards it as  http://...webservice.asmx to the iis and the iis returned the result like from a normal http call, but after that there must be a problem because the silverlight application gets no completed event and no result.

    I hope you can follow my explanation.

    Are there some kind of settings, so that the webservice works?

    Best regards

    André

     

    Friday, October 4, 2013 4:39 AM

Answers

  • User-1727801661 posted

    Now I found the solution,

    problem is, the the default security settings of a simple web service is   <security mode="None" />

    in my case it must set to <security mode="Transport" />.

    These setting could modified in the ServiceReferences.ClientConfig file or in the code behind by calling the service with some parameters.

    string uri = Application.Current.Host.Source.AbsoluteUri;
    BasicHttpBinding transportSecurityBinding = new BasicHttpBinding(BasicHttpSecurityMode.Transport);
    EndpointAddress ep = new EndpointAddress( uri + @"TestWebService1.asmx");

    test = new TestServiceReference1.TestWebService1SoapClient(transportSecurityBinding, ep);
    test.HelloWorldCompleted += new EventHandler<TestServiceReference1.HelloWorldCompletedEventArgs>(test_HelloWorldCompleted);
    test.HelloWorldAsync();

    Best regards

    André

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 10, 2013 9:09 AM

All replies

  • User260886948 posted

    Hi,

    It seems that your load balancer will redirect traffic from 443 port to custom defined (for example 543 port) of your physical boxes.  This is creating problem of contact mistmatching since Silverlight has precompiled setting of endpoint without any knowledge how mapping is done. In order to make it working you need full domain name specified in your endpoint address and listenUri attribute which contains reference to localhost with custom ssl port number.

    For more information, please try to refer to this article:
    http://www.gtrifonov.com/2009/09/22/wcf-iis-settings-for-load-balanced-https/ .

    Best Regards,
    Amy Peng

     

     

    Monday, October 7, 2013 6:01 AM
  • User-1727801661 posted

    Hi,

    are these settings possible with a simple Web Service like the sample below?

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.Services;

    namespace Auditor_Webservice
    {
        /// <summary>
        /// Summary description for WebService2
        /// </summary>
        [WebService(Namespace = "http://tempuri.org/")]
        [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
        [System.ComponentModel.ToolboxItem(false)]
        // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
        // [System.Web.Script.Services.ScriptService]
        public class WebService2 : System.Web.Services.WebService
        {

            [WebMethod]
            public string HelloWorld()
            {
                return "Hello World";
            }
        }
    }

     

    Best regards

    André

     

     

    Tuesday, October 8, 2013 7:55 AM
  • User-1727801661 posted

    Now I found the solution,

    problem is, the the default security settings of a simple web service is   <security mode="None" />

    in my case it must set to <security mode="Transport" />.

    These setting could modified in the ServiceReferences.ClientConfig file or in the code behind by calling the service with some parameters.

    string uri = Application.Current.Host.Source.AbsoluteUri;
    BasicHttpBinding transportSecurityBinding = new BasicHttpBinding(BasicHttpSecurityMode.Transport);
    EndpointAddress ep = new EndpointAddress( uri + @"TestWebService1.asmx");

    test = new TestServiceReference1.TestWebService1SoapClient(transportSecurityBinding, ep);
    test.HelloWorldCompleted += new EventHandler<TestServiceReference1.HelloWorldCompletedEventArgs>(test_HelloWorldCompleted);
    test.HelloWorldAsync();

    Best regards

    André

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 10, 2013 9:09 AM