wcf - IBM DataPower 3.7.1.x 与 WCF 客户端相关的问题

标签 wcf interop ws-security x509 ibm-datapower

我尝试在 WCF 中使用 IBM DataPower 3.7.1.x Web 服务,但收到以下错误消息:

找不到“System.IdentityModel.Tokens.X509SecurityToken” token 类型的 token 验证器。根据当前的安全设置,无法接受该类型的 token 。

HTTP 响应返回为 200,我可以在 Fiddler 中调试时看到正确的 SOAP 响应。

但是,WCF 客户端似乎不知道如何处理 SOAP 响应中的 BinarySecurityToken 元素。

这是我的 WCF 配置:

  <bindings>
    <basicHttpBinding>
      <binding name="TestBinding">
        <security mode="TransportWithMessageCredential">
          <message clientCredentialType="Certificate" />
        </security>
      </binding>
    </basicHttpBinding>
  </bindings>

  <behaviors>
    <endpointBehaviors>
      <behavior name="TestBehavior">
        <callbackDebug includeExceptionDetailInFaults="true" />
        <clientCredentials>
          <clientCertificate storeLocation="LocalMachine" 
                             storeName="My" 
                             x509FindType="FindBySubjectName" 
                             findValue="test-cert"  />
          <serviceCertificate>
            <authentication certificateValidationMode ="PeerOrChainTrust" />
          </serviceCertificate>
        </clientCredentials>
      </behavior>
    </endpointBehaviors>
  </behaviors>

  <client>
     <endpoint  address="https://serviceURL"
                binding="basicHttpBinding"
                bindingConfiguration="TestBinding"
                behaviorConfiguration="TestBehavior"
                contract="ContraceGoesHere"
                name="ContraceNameGoesHere" />
  </client>

我看到其他人向 Microsoft 和 IBM 报告了类似的问题,并且有一些与此相关的 StackOverflow 问题,但我还没有找到有效的解决方案。

如有任何帮助,我们将不胜感激。

最佳答案

请发布您发送的肥皂、返回的肥皂以及您的配置。

也尝试添加此属性:

<security allowSerializedSigningTokenOnReply="true" />

(如所述here)

关于wcf - IBM DataPower 3.7.1.x 与 WCF 客户端相关的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5503684/

相关文章:

c# - 如何获取进程使用的所有内存地址空间?

wcf - 无法从端口解除绑定(bind)证书 (Windows 7)

wcf - 处理大型对象的 WCF 服务

wcf - 如何拦截 WCF 中反序列化后的请求对象

c# - 帮助解决简单的 restful post 问题

c# - 创建 WCF Rest 服务以接受 SAML 并对 Windows 用户进行身份验证

c# - 从传回完整对象模型的非托管 C++ 调用 C# 方法

.net - .net 的 CUDA 绑定(bind)?

具有传输和消息安全性的 WCF 绑定(bind)

c# - 如何使用 WS-Security 并从 ASMX Web 服务访问 UsernameToken?