none
The provided URI scheme 'http' is invalid; expected 'https

    Question

  • Hi,

    I have created a simple WCF webservice and exposed it with a asp.net host.

    I use windows client and generate the proxy class for the webservice.
    I am using wshttpbinding for security. When I execute the client and the first method in the service gets called I get an exception message
    "The provided URI scheme 'http' is invalid; expected 'https" Any Idea why this might be happening.

    Here is my service configuration
    <client>
                <endpoint address="http://localhost:1101/WCFService1.Host/WSHttpService.svc"
                    binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IWSHttpService"
                    contract="WCFService1.Client.WSHttpServ.IWSHttpService" name="WSHttpBinding_IWSHttpService">
                </endpoint>
    </client>


    <bindings>
            <wsHttpBinding>
                    <binding name="WSHttpBinding_IWSHttpService" closeTimeout="00:01:00"
                        openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                        bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                        maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                        messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
                        allowCookies="false">
                        <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                        <reliableSession ordered="true" inactivityTimeout="00:10:00"
                            enabled="false" />
                        <security mode="Transport">
                            <transport clientCredentialType="None" proxyCredentialType="None"
                                realm="" />
                            <message clientCredentialType="None" negotiateServiceCredential="true"
                                algorithmSuite="Default" establishSecurityContext="true" />
                        </security>
                    </binding>
            </wsHttpBinding>
    </bindings>
    Wednesday, June 06, 2007 9:40 PM

Answers

  • You have <security mode="Transport"> on the binding.  This means it uses https.  Change the <endpoint address=...> to agree, or change to a non-transport-security http binding.

    Was this svcutil-generated (Add Web Referenc) config?  What does the server config look like?  It is surprising to generate 'inconsistent' config like this from the metadata.

    Wednesday, June 06, 2007 10:36 PM