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

时间:2015-06-24 14:37:47   收藏:0   阅读:2614

 

 

前几天,在用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" />

 

重新编译,运行成功。

原文:http://www.cnblogs.com/for917157ever/p/4597551.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!