java的xml如下:
<soap:Envelope xmlns:soap=" http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd=" http://www.w3.org/2001/XMLSchema" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance">
<soap:Header>
<wsse:Security soap: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-13120210" xmlns:wsse=" http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu=" http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:Username xmlns:wsse=" adminhttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">admin</wsse:Username>
<wsse:Password Type=" http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText" xmlns:wsse=" adminhttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">admin</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soap:Header>
<soap:Body>
<ns1:authenticate xmlns:ns1=" http://webservice.repair.wxcrg.com.cn">
<ns1:in0>sanders</ns1:in0>
<ns1:in1>950F7192C6B606A2</ns1:in1>
</ns1:authenticate>
</soap:Body>
</soap:Envelope>
在.net这边代理类,根据网上的一些方法,都是修改代理类增加
public partial class MyHeader : SoapHeader
{
public string username;
public string passwored;
}继承soapHeader的类,然后在要调用的方法上面加
[System.Web.Services.Protocols.SoapHeaderAttribute("myHeader", Direction = SoapHeaderDirection.In, Required = true)]
这么处理后,还是会报System.Web.Services.Protocols.SoapHeaderException:
实在找不出什么原因。望各位高手指点一二,谢谢。