0
votes

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>
</soapenv:Envelope>
1

1 Answers

0
votes

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