我正在尝试使用 basicHttpBinding 设置流式 WCF 服务。该服务托管在 IIS7 进程中。
合约包含一个简单的 Stream GetStream() 操作。
当我使用服务参考连接一个简单的客户端时,我从服务器得到以下结果。
内容类型多部分/相关;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>