我有一個WCF服務在我的本地機器上正常運行。我把它放在服務器上,我收到以下錯誤:這可能是由於服務端點綁定不使用HTTP協議
An error occurred while receiving the HTTP response to http://xx.xx.x.xx:8200/Services/WCFClient.svc . This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.]
我已經去了服務的網址,它工作正常。我爲這個函數所做的所有事情都是將一個字符串返回給圖像名稱,所以傳遞的數據不是很多。我跟蹤了日誌,它給了我相同的信息。這裏是我的客戶端配置:
<binding name="basicHttpBinding_IWCFClient" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
<endpoint name="basicHttpBinding_IWCFClient"
address="http://localhost:4295/Services/WCFClient.svc"
binding="basicHttpBinding"
bindingConfiguration="basicHttpBinding_IWCFClient"
behaviorConfiguration="WCFGraphicManagementTool.Services.ClientBehavior"
contract="WCFClient.IWCFClient" />
這裏是我的服務器配置:
<service behaviorConfiguration="WCFGraphicManagementTool.Services.WCFClientBehavior"
name="WCFGraphicManagementTool.Services.WCFClient">
<endpoint name="basicHttpBinding_IWCFClient"
address=""
binding="basicHttpBinding"
contract="WCFGraphicManagementTool.Contracts.IWCFClient" />
<endpoint
address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
<behavior name="WCFGraphicManagementTool.Services.WCFClientBehavior">
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
<serviceThrottling maxConcurrentCalls="120" maxConcurrentSessions="120"
maxConcurrentInstances="120" />
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
這將是服務器上的設置,因爲它的工作原理我的本地機器上?
我解決了我的問題,因爲我在這裏解釋:http://stackoverflow.com/questions/5537794/error-while-deserializing-the-object-in-wcf/8415908#8415908 – Adi 2011-12-07 13:25:04
似乎你比我更進一步。也許你可以給我一個接下來要做什麼的指示。 http://stackoverflow.com/questions/16628382/setting-up-wcf-tcp-service-in-a-web-application – 2013-05-25 08:35:52
任何機會,你會接受任何答案,因爲我懷疑你還在等待得到一個 ? :) – Noctis 2014-08-19 06:03:11