0 0

java调用带SoapHeader验证的WebService20

最近项目中遇到webservice应用,需要调用webservice接口进行查询,主要问题还是WebService接口在SOAP头上面搞了些验证的东西,需要传一个SOAP头过去。。。

之前调用webservice都是没带SoapHeader验证的
直接
JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
Client client = dcf.createClient("http://xxxxxxx?wsdl");// 创建client客户端

现在这个需要SoapHeader验证,忙活了一天,没找到具体的办法

求大神指导,最好能给出具体代码

下面是soapUI的project

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://aaa.bbb.ccc.ddd.eee">
<soapenv:Header soapenv:mustUnderstand="0" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <wees:Security xmlns:wees="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
        <wees:AuthenticationToken>
            <wees:Username>xxx</wees:Username>
            <wees:Password>xxx</wees:Password>
        </wees:AuthenticationToken>
        </wees:Security>
   </soapenv:Header>
   <soapenv:Body>
      <web:getUserEmailByNumberPidAndUsername>
         <web:credentialsType>PC8LcYreylODxwQCLGcyAg==</web:credentialsType>
         <web:numberPid>C1wKRXyYN1avAWAmmP5hvwO9tXwRDs6l</web:numberPid>
         <web:username>1ICoaYQiCfyEkMkYjgOJCg==</web:username>
      </web:getUserEmailByNumberPidAndUsername>
   </soapenv:Body>
</soapenv:Envelope>
2014年12月04日 20:27
目前还没有答案

相关推荐

Global site tag (gtag.js) - Google Analytics