tags:

views:

296

answers:

1

I've generated the java code from wsdl using WSDL2Java. I create a SOAP requestand I send it to the server, which answers with an AxisFault. If I have a look in the soap request there is now 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/"&gt;
   <soapenv:Header/>
   <soapenv:Body>
   ...
   </soapenv:Body>
</soapenv:Envelope>
A: 

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"/>
lasombra