我正在尝试将一些基于 WSE3.0 的代码移植到 WCF。基本上,旧代码具有以下配置:
<microsoft.web.services3>
<diagnostics>
<trace enabled="true" input="InputTrace.webinfo" output="OutputTrace.webinfo" />
</diagnostics>
<tokenIssuer>
<statefulSecurityContextToken enabled="false" />
</tokenIssuer>
</microsoft.web.services3>
通过我的“服务参考”调用相同的服务时,我收到此错误:
请求不包含必需的安全标头
我的绑定看起来像这样:
<basicHttpBinding>
<binding name="LegalUnitGetBinding" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="Transport">
</security>
</binding>
</basicHttpBinding>
据我了解,我调用的服务只需要 SSL 连接,因为它接收用户名和密码作为请求参数的一部分。
任何帮助或建议将不胜感激。