2009-01-26 31 views
1

我正在尝试使用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> 
+0

请粘贴在您的客户端配置部分。 – 2009-01-26 19:34:27

回答

1

相关错误的部分是“客户端和服务绑定可能不匹配”。

由于您在服务器上使用transfermode“Streamed”,并且“Buffered”是默认值,所以这可能是不匹配的。