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