WCF异常: 提供的 URI 方案“https”无效,应为“http”。 参数名: via


 

 

前几天,在用wcf服务是,遇到这么一个问题:WCF异常: 提供的 URI 方案“https”无效,应为“http”。 参数名: via

本身对wcf不是很熟悉,在网上查找一番。终于解决问题。如有遇到此类问题,希望能有所帮助。

 

原因解析:

wcf原引用地址:https://192.168.1.1:8090/temp/sitservice

后因为服务地址改为:http://192.168.1.2:8090/temp/sitservice

然后运行就出现了上述的错误(我只改了web.config 的引用服务地址,别的没改)。

 

解决:

把这个节点

<httpsTransport manualAddressing="false" maxBufferPoolSize="524288"
maxReceivedMessageSize="65536" allowCookies="false" authenticationScheme="Anonymous"
bypassProxyOnLocal="false" decompressionEnabled="true" hostNameComparisonMode="StrongWildcard"
keepAliveEnabled="true" maxBufferSize="65536" proxyAuthenticationScheme="Anonymous"
realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"
useDefaultWebProxy="true" />

改为http的

<httpTransport manualAddressing="false" maxBufferPoolSize="524288"
maxReceivedMessageSize="65536" allowCookies="false" authenticationScheme="Anonymous"
bypassProxyOnLocal="false" decompressionEnabled="true" hostNameComparisonMode="StrongWildcard"
keepAliveEnabled="true" maxBufferSize="65536" proxyAuthenticationScheme="Anonymous"
realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"
useDefaultWebProxy="true" />

 

重新编译,运行成功。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM