我正在嘗試使用basicHttpBinding設置流式WCF服務。該服務託管在IIS7進程中。WCF流合同
契約包含一個簡單的Stream GetStream()操作。
當我使用Service Reference與簡單客戶端連接時,我從服務器獲得以下結果。
內容類型multipart/related; type =「application/xop + xml」; start =「http://tempuri.org/0」; boundary =「uuid:9520d099-4241-43f3-824d-5a3d197f62ed + id = 1」;服務不支持start-info =「text/xml」 http://localhost:6000/StreamingTest.svc。客戶端和服務綁定可能不匹配。
這是客戶端上的綁定配置。名爲「streaming_IStreamingTestService」的綁定部分是服務器上的精確副本。按Ctrl + X。
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="streaming_IStreamingTestService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="655360" maxBufferPoolSize="655360" maxReceivedMessageSize="655360"
messageEncoding="Mtom" transferMode="Streamed" 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>
</bindings>
<client>
<endpoint address="http://localhost:8000/StreamingTest.svc"
binding="basicHttpBinding" bindingConfiguration="streaming_IStreamingTestService"
contract="Services.StreamingTest.IStreamingTestService" name="streaming_IStreamingTestService" />
</client>
</system.serviceModel>
</configuration>
請粘貼在您的客戶端配置部分。 –
2009-01-26 19:34:27