none
WebService and authenticataion RRS feed

  • Question

  • I'm tryng to reach (with a browser) the endpoint at https://xxx.yyy.ttt.zzz/some/endpoint, this page list all accessible WSDL, but I have an error adverting me that the certificate is for another URL (e.g.: hostname-test-something.local). If I choose to ignore warning I can continue to the next page. So i've modified the Windows hosts file (binding ip address xxx.yyy.ttt.zzz with hostname-test-something.local) and the error is disappeared when called in a browser.

    I need to reach the webservice even inside Visual Studio 2012 project, so i've installed the certificate inside windows environment, imported the service reference but I get:

     An error occurred while making the HTTP request to https://hostname-test-something.local/some/endpoint. This could be
     due to the fact that the server certificate is not configured properly
     with HTTP.SYS in the HTTPS case. This could also be caused by a
     mismatch of the security binding between the client and the server.

    And this is my `App.config`
        
    <?xml version="1.0" encoding="utf-8" ?>
        <configuration>
            <startup> 
                <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
            </startup>
            <system.serviceModel>
                <bindings>
                    <basicHttpsBinding>
                        <binding name="WorkingStatusPortBinding">
                            <security mode="Transport" />
                        </binding>
                        <binding name="WorkingStatusPortBinding1" />
                    </basicHttpsBinding>
                </bindings>
                <client>
                    <endpoint address="https://hostname-test-something.local/some/endpoint"
                        binding="basicHttpsBinding" bindingConfiguration="WorkingStatusPortBinding"
                        contract="WSWorkingStatus.WorkingStatus" name="WorkingStatusPort" />
                </client>
            </system.serviceModel>
        </configuration>
    and this is how I call that service in visual studio.
        WSWorkingStatus.WorkingStatus ws = new WSWorkingStatus.WorkingStatusClient();
        WSWorkingStatus.statusRequest r = new WSWorkingStatus.statusRequest();
        WSWorkingStatus.statusResponse1 x = ws.status(r); // this is where exception happen
    
    I have no idea, about this issue. What can I do?

    PS: If I call the service through soapUI i can reach the service with no problem.
    Friday, November 22, 2013 2:43 PM

Answers

  • Hi,

    >>An error occurred while making the HTTP request to https://hostname-test-something.local/some/endpoint. This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server.

    It seems that the certificate for HTTPS is not configured in WCF configuration. You must configure certificate for http.sys. To do that use netsh.exe from command line with elevated privileges. If you are hosting your service in IIS/WAS you don't have to use netsh and you can configure HTTPS directly in IIS .

    Also please try to enabled tracing and then used the ServiceTraceViewer to analyze the logs, then you will get much, much better information about these horrible general errors that way.

    #How to enable the WCF Tracing:
    http://msdn.microsoft.com/en-us/library/ms733025.aspx .

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, November 27, 2013 10:30 AM
    Moderator