我正在尝试配置WCF客户端,以便能够使用返回以下响应消息的Web服务:
回复消息
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="http://myservice.wsdl">
<env:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" env:mustUnderstand="1" />
</env:Header>
<env:Body>
<ns0:StatusResponse>
<result>
...
</result>
</ns0:StatusResponse>
</env:Body>
</env:Envelope>
为此,我构建了一个自定义绑定(不起作用)。我一直收到“安全标题为空”的消息。
我的约束力:
<customBinding>
<binding name="myCustomBindingForVestaServices">
<security authenticationMode="UserNameOverTransport"
messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11"
securityHeaderLayout="Strict"
includeTimestamp="false"
requireDerivedKeys="true">
</security>
<textMessageEncoding messageVersion="Soap11" />
<httpsTransport authenticationScheme="Negotiate" requireClientCertificate ="false" realm =""/>
</binding>
</customBinding>
我的请求似乎使用与响应相同的SOAP和WS Security版本,但使用不同的名称空间前缀(“o”而不是“wsse”)。这可能是我不断收到“安全标题是空的”消息的原因吗?
请求消息
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<s:Header>
<o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<o:UsernameToken u:Id="uuid-d3b70d1f-0ebb-4a79-85e6-34f0d6aa3d0f-1">
<o:Username>user</o:Username>
<o:Password>pass</o:Password>
</o:UsernameToken>
</o:Security>
</s:Header>
<s:Body>
<getPrdStatus xmlns="http://myservice.wsdl">
<request xmlns="" xmlns:a="http://myservice.wsdl" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
...
</request>
</getPrdStatus>
</s:Body>
</s:Envelope>
如何配置我的WCF客户端绑定以使用此Web服务?
任何帮助都非常感谢!
桑德
答案 0 :(得分:0)
以下kb文章中似乎解决了我的问题:http://support.microsoft.com/kb/971493/
尚未能够下载修复程序,因为似乎没有可用的下载链接...将保持此主题更新。