问题描述
我有一个服务调用,这是造成以下错误:提供的URI方案'HTTP'是无效的;预期的https
app.config中的值:
<&basicHttpBinding的GT;
<绑定名称=xx_xxxxx_spcNamecloseTimeout =00:01:00
openTimeout =00:01:00receiveTimeout =00:10:00的SendTimeout =00:01:00
allowCookies =假bypassProxyOnLocal =假hostNameComparisonMode =StrongWildcard
MAXBUFFERSIZE =655360maxBufferPoolSize =524288maxReceivedMessageSize =655360
messageEncoding =TEXTtextEncoding =UTF-8transferMode =缓冲
useDefaultWebProxy =真正的>
< readerQuotas MAXDEPTH =32maxStringContentLength =8192maxArrayLength =16384
maxBytesPerRead =4096maxNameTableCharCount =16384/>
<安全模式=运输>
<运输clientCredentialType =无/>
< /安全>
< /&结合GT;
< / basicHttpBinding的>
<客户端>
<端点地址=HTTP://服务器/ serviceaddress_removed
绑定=basicHttpBinding的bindingConfiguration =xx_xxxxx_spcName
合同=xx.xx_xxxxx_spcNameNAME =xx_xxxxx_spcName/>
< /客户>
我用尽https://开头,但万物内在所以不希望我需要这个,再说这也给客户端/服务器错误
。我也试图改变绑定类型
我也通过其他论坛的帖子看着这里asp.net和所有在好像用运输和传递,我正在做我的code客户端凭据点如下:
client.ClientCredentials.UserName.UserName =XXXXX;
client.ClientCredentials.UserName.Password =XXXXX;
您必须修改<安全模式=运输>
无法比拟的。交通运输部队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.
这篇关于Web服务错误&QUOT;所提供的URI方案'HTTP'是无效的;预期的“https'&QUOT。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!