我制作了用于使用java web服务的客户端应用程序。当我通过SOAPUI发布请求时,我得到了常规响应,但是从wcf客户端运行相同的请求会给我一个错误:
"标题'安全'来自命名空间' http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'此邮件的收件人不理解该邮件,导致邮件无法处理。此错误通常表示......
我的请求如下:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<wsse:Security mustUnderstand="1" xmlns:wsse="http://docs.oasis- open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-Comtrade" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:Username>USERNAME</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">PASSWORD</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<getPortedOutMsisdnsByDate xmlns="http://www.ericsson.com/schema/ts_sdp/portedinout/v1_0/local">
<msisdnsDate>2014-03-14T10:32:43.1896067+01:00</msisdnsDate>
</getPortedOutMsisdnsByDate>
</s:Body>
我的客户端配置:
<client>
<endpoint address="http://x.x.x.x:8080/SubscriptionManagerService/services/SdpPortedInOut"
binding="basicHttpBinding" bindingConfiguration="SdpBinding"
contract="ISdpPortedInOut" name="Sdp" >
<headers>
<wsse:Security mustUnderstand='1' xmlns:wsse='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'>
<wsse:UsernameToken wsu:Id='UsernameToken-Comtrade' xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'>
<wsse:Username>USERNAME</wsse:Username>
<wsse:Password Type='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText'>PASSWORD</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</headers>
</endpoint>
</client>
将mustUnderstand更改为0并不能解决问题。