【发布时间】:2010-04-30 21:00:08
【问题描述】:
我正在尝试使用 WCF 客户端调用第三方 Web 服务。 Web Service 使用用户名令牌认证 WSS-Security 1.0 Soap Message Security
这里是 web 服务期望的示例 soap 身份验证标头
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<wsse:Security soap:mustUnderstand="1">
<wsse:UsernameToken namespaces>
<wsse:Username>username</wsse:Username>
<wsse:Password Type="type info">password</wsse:Password>
<wsse:Nonce>nonce</wsse:Nonce>
<wsu:Created>date created</wsu:Created>
</wsse:UsernameToken>
<wsse:Security>
</soap:Header>
<soap:Body>
<WebServiceMethodName xmlns="Web Service Namespace" />
我将客户端配置为以下方式
<basicHttpBinding>
<binding name="Binding1">
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="Basic"/>
</security>
</basicHttpBinding>
但收到一个错误,指出标头中缺少 nonce 和 datecreated 属性。有谁知道如何配置 WCF 客户端以使用
WSS-Security 1.0 Soap Message Security 用户名令牌认证?
【问题讨论】:
标签: wcf