我有一個單向的WCF服務,其主要目的是讓網頁內容作爲一個字符串,並進行一些操作。但是我似乎無法打電話給運營合同。它只是不會被調用。如果不是WebPage內容,我會發送短文本(「Hello World」),一切都按預期工作。我在web.config中將maxReceiveMessageSize設置爲max,但我仍然無法傳遞WebPage內容。下面是客戶端的web.config無法調用單向操作的合同在WCF
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="basicBinding" allowCookies="false" closeTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647"
maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" messageEncoding="Text"
textEncoding="utf-8" transferMode="Buffered">
<readerQuotas maxDepth="64" maxStringContentLength="2147483647" maxArrayLength="16384" maxBytesPerRead="2147483647"
maxNameTableCharCount="16384"/>
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint name="basicHttpEndPoint"
address="http://localhost:7777/Serializer.svc"
binding="basicHttpBinding"
contract="Shared.ISerializer"
bindingConfiguration="basicBinding" />
</client>
這裏是我服務的web.config
<system.serviceModel>
<services>
<service name="SerializerService">
<endpoint address=""
binding="basicHttpBinding"
bindingConfiguration="basicBinding"
contract="Shared.ISerializer" />
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="basicBinding" allowCookies="false" closeTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647"
maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" messageEncoding="Text"
textEncoding="utf-8" transferMode="Buffered">
<readerQuotas maxDepth="64" maxStringContentLength="2147483647" maxArrayLength="16384"
maxBytesPerRead="2147483647" maxNameTableCharCount="16384"/>
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
我缺少的東西?提前致謝。
你試過使WCF跟蹤(如本文檔中http://msdn.microsoft.com/en-us/library/ms733025.aspx解釋) ? – JohnC
嗨,約翰,感謝您的快速回復,不,我沒有收到400錯誤請求錯誤。 – Michael