我必須從我的WCF服務庫調用第三方web服務。當我從測試應用程序調用的第三方網絡服務,是沒有問題的,但是當我從我的WCF服務調用,有一個錯誤:從wcf服務調用第三方web服務
An error occurred while receiving the HTTP response to xxx.svc/ws. This could be...
我已經添加了第三方Web服務與Add Service Reference
。
<wsHttpBinding>
<binding name="WSHttpBinding_xxxService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false"
hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
<security mode="None">
<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true" />
</security>
</binding>
</wsHttpBinding>
綁定是不同的:
<basicHttpBinding>
<binding name="basicHttpBinding" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
綁定我的WCF服務的自動測試app.config
文件生成,但綁定第三方爲Web服務綁定作爲自動生成服務僅在WCF應用程序配置中生成。
我在做什麼錯?
您可以向我們展示您用來致電該第三方網絡服務的**代碼**嗎?你給我們展示的配置看起來很好 - 除了我們只看到綁定 - 沒有別的。您沒有向我們展示客戶端端點配置(URL,合同等) –
在WCF服務和測試程序中我試圖用同樣的方式調用它:xxx_Ws.xxxClient client = new xxxClient(); client.Function(); – user1435135
跟蹤無響應服務的活動可以讓我們瞭解爲什麼沒有響應。還要確保你沒有達到這些配額。 – insipid