【发布时间】:2012-02-28 08:03:16
【问题描述】:
我有一个 WCF 服务:
- 使用
BasicHttpBinding(如果你能回答WsHttpBinding就更好了!) - 使用
TransportWithMessageCredential安全 - 使用 X.509 证书确保传输和消息安全
我希望能够使用 SoapUI 测试此服务。
但是,当我尝试这样做时,SoapUI 签署的消息似乎比 WCF 预期的要多,从而导致此错误(在启用 ServiceModel 审核后在应用程序日志中检测到):
CryptographicException: Unable to resolve the '#id-100' URI in the signature to compute the digest.
或者,当我使用 WsHttpBinding 时,我得到了异常:
MessageSecurityException: The message received over Transport security has unsigned 'To' header.
以前曾提出过类似的问题:
- WCF rejects messages with additional signed elements
- http://connect.microsoft.com/VisualStudio/feedback/details/481030/wcf-signed-parts
- Getting WCF to accept unsigned 'To' Header
这并不是一个“Java 与 MS WCF 对话”的问题——我有一个 Java 测试客户端可以正常工作。同样,我可以使用 WCFStorm 来测试服务。然而,SoapUI 已成为一种事实上的测试标准,尤其是对于非 Windows 用户而言。
那么,有没有人设法克服这些问题并使用 SoapUI 测试受证书保护的 WCF 服务?
谢谢
我相信这个问题是无法解决的,基于我自己的测试和 250 赏金没有产生答案。
“web.config”是动态生成的,但它有效地匹配以下任一绑定:
<wsHttpBinding>
<binding name="WSHttpBinding_ITwoWayAsync" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="250000" maxReceivedMessageSize="250000"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="Certificate" proxyCredentialType="None" realm="" />
<message clientCredentialType="Certificate" negotiateServiceCredential="false"
establishSecurityContext="false"
algorithmSuite="Default" />
</security>
</binding>
</wsHttpBinding>
<basicHttpBinding>
<binding name="BasicHttpBinding_ITwoWayAsync" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="250000" maxReceivedMessageSize="250000"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="Certificate" proxyCredentialType="None" realm="" />
<message clientCredentialType="Certificate" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
【问题讨论】:
-
您能在 web.config 文件中分享您的 system.servicemodel 设置吗?
标签: wcf biztalk x509certificate soapui