简体   繁体   中英

Web Service Error “The provided URI scheme 'http' is invalid; expected 'https'.”

I have a service call which is causing the following error: "The provided URI scheme 'http' is invalid; expected 'https'."

app.config values:

<basicHttpBinding>
<binding name="xx_xxxxx_spcName" closeTimeout="00:01:00"
              openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
              allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
              maxBufferSize="655360" maxBufferPoolSize="524288" maxReceivedMessageSize="655360"
              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" />
          </security>
        </binding>
</basicHttpBinding>


<client>
<endpoint address="http://server/serviceaddress_removed" 
                binding="basicHttpBinding" bindingConfiguration="xx_xxxxx_spcName" 
                contract="xx.xx_xxxxx_spcName" name="xx_xxxxx_spcName" />
</client>

Ive tried Https:// but everythings internal so wouldn't expect I need this, besides it also gives a client/server error.

I've also tried changing the binding type

I've also looked through other forum posts on here and asp.net and all seem to point at using Transport and passing in client credentials which I'm doing in my code as follows:

client.ClientCredentials.UserName.UserName = "XXXXX";
client.ClientCredentials.UserName.Password = "XXXXX";

You have to change <security mode="Transport"> to none. Transport forces https.

If I remember my WCF configuration training, Transport security specifically means that you are using HTTPS. If you're not using HTTPS, your security type should be set to "None", knowing that your message will be unencrypted.

I believe you can also use "Message" and provide a certificate manually, but I haven't done that before.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM