views:

19

answers:

1

I have a web service that contains a method I need to run to generate a report. The web service method is written in .Net 2.0 and works fine on my test system which runs on the same server as the live system. The only difference is that the live version uses https.

Whenever I change the endpoint address to the live service and run my application I only get 400(bad request) errors back from IIS.

Is there some specific configuration setting I need to change in the WCF settings in the app.config to get it to work with https?

The generated app.config settings created by "Add service reference" are as follows:

<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="ReportsSoap" closeTimeout="00:01:00" openTimeout="00:01:00"
                receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
                bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                useDefaultWebProxy="true">
                <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                    maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                <security mode="Transport" >
                    <transport clientCredentialType="None" proxyCredentialType="None"
                        realm="" />
                    <message clientCredentialType="UserName" algorithmSuite="Default" />
                </security>
            </binding>

        </basicHttpBinding>
    </bindings>
    <client>

        <endpoint address="https://www.mysite.com/subdir/subdir/Reports.asmx"
            binding="basicHttpBinding" bindingConfiguration="ReportsSoap"
            contract="SystemReports.ReportsSoap" name="ReportsSoap" />
    </client>
</system.serviceModel>
+1  A: 

Yes you have to change binding configuration to use transport security.

<bindings>
  <basicHttpBinding>
    <binding name="YourCurrentBindingName" ...>
      <security mode="Transport" />
    </binding>
  </basicHttpBinding>
</bindings>
Ladislav Mrnka
It was already there. I have changed it to be more like what you described but it still gives the same error. I have included my generated binding configuration in the question now.
Tjaart