开发者

Axis2 and WSDL2Java: SOAP header is missing

开发者 https://www.devze.com 2022-12-27 01:20 出处:网络
I\'ve generated the java code from wsdl using WSDL2Java. I create a SOAP request and I send it to the server, which answers with an AxisFault. If I have a look in the soap request there is no header t

I've generated the java code from wsdl using WSDL2Java. I create a SOAP request and I send it to the server, which answers with an AxisFault. If I have a look in the soap request there is no header tag . Why not?

Does the follwing line in the stub not add a header?

// adding SOAP soap_headers
_serviceClient.addHeadersToEnvelope(env);

What would be the solution to add a header, so that the SOAP request looks like that:

<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header/>
   <soapenv:Body>
   ...
   </soapenv:Body>
开发者_JAVA技巧</soapenv:Envelope>


According to http://schemas.xmlsoap.org/soap/envelope/ (SOAP V1.1) the header does not need to be part of the outgoing soap request:

<xs:element ref="tns:Header" minOccurs="0"/>
0

精彩评论

暂无评论...
验证码 换一张
取 消