Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 向Webservice请求添加自定义Soap头_Java_Web Services_Axis2_Webservice Client_Wsdl2java - Fatal编程技术网

Java 向Webservice请求添加自定义Soap头

Java 向Webservice请求添加自定义Soap头,java,web-services,axis2,webservice-client,wsdl2java,Java,Web Services,Axis2,Webservice Client,Wsdl2java,我已经使用ApacheAxis2为webserivce生成了存根,我想向请求中添加自定义soap头,我希望soap头看起来像这样 <soapenv:Header xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><ns1:soapHeader xmlns:ns1="urn:oasis:names:core" soapenv:mustUnderstand="0"><ns1:Username>myu

我已经使用ApacheAxis2为webserivce生成了存根,我想向请求中添加自定义soap头,我希望soap头看起来像这样

<soapenv:Header xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><ns1:soapHeader xmlns:ns1="urn:oasis:names:core" soapenv:mustUnderstand="0"><ns1:Username>myuser</ns1:Username><ns1:Password>mypass</ns1:Password></ns1:soapHeader></soapenv:Header>
但我没有得到必要的soap头,这是我得到的

 <soapenv:Header xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><ns1:soapHeader xmlns:ns1="urn:oasis:names:core" soapenv:mustUnderstand="0"><ns1:Username>myuser</ns1:Username></ns1:soapHeader></soapenv:Header>
myuser
正如你看到的密码丢失,我想知道我做错了什么

 <soapenv:Header xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><ns1:soapHeader xmlns:ns1="urn:oasis:names:core" soapenv:mustUnderstand="0"><ns1:Username>myuser</ns1:Username></ns1:soapHeader></soapenv:Header>