【发布时间】:2010-07-29 21:44:27
【问题描述】:
我正在努力处理这个双工 WCF 服务,它调用该服务来获取大量数据。 我正在使用 wsDualHttpBinding,它可以工作但速度很慢。我分析了大部分时间都被序列化程序和身份验证过程使用。所以我决定使用二进制编码并将安全性更改为传输,因为它是一个内部网应用程序,所以不需要加密。
<wsDualHttpBinding>
<binding name="CRMXServiceDualBinding" sendTimeout="00:10:00"
maxBufferPoolSize="50524288" maxReceivedMessageSize="50000000"
messageEncoding="Mtom">
<readerQuotas maxDepth="50000000" maxStringContentLength="50000000"
maxArrayLength="50000000" maxBytesPerRead="50000000" maxNameTableCharCount="50000000" />
<reliableSession ordered="true" inactivityTimeout="00:30:00" />
<security mode="Message">
<message clientCredentialType="Windows" negotiateServiceCredential="true" />
</security>
</binding>
</wsDualHttpBinding>
所以我尝试编写这个自定义绑定。
<customBinding>
<binding name="DuplexBindingConfig">
<compositeDuplex />
<oneWay maxAcceptedChannels="128" packetRoutable="false">
<channelPoolSettings idleTimeout="00:10:00" leaseTimeout="00:10:00"
maxOutboundChannelsPerEndpoint="10" />
</oneWay>
<binaryMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</binaryMessageEncoding>
<httpTransport manualAddressing="false" maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647" allowCookies="false" authenticationScheme="Negotiate"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
keepAliveEnabled="true" maxBufferSize="2147483647" proxyAuthenticationScheme="Anonymous"
realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"
useDefaultWebProxy="true" />
</binding>
</customBinding>
现在我面临两个问题: 1. 在 ASP.Net 开发服务器上测试它立即返回错误: “HTTP 请求未经客户端身份验证方案‘协商’未经授权。从服务器收到的身份验证标头为‘NTLM’。” 2.在IIS6上测试,调用永远不会到达服务器。 我的预感是客户端端口没有被打开。
请帮助..提前致谢。
*顺便说一句,我使用的是 Windows XP SP3、Framework 3.5 SP1、VS2008
【问题讨论】:
标签: c# wcf authentication encoding binding