0

I've been told that my soap header must be like this :

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ws="http://ws.dgpys.deloitte.com">
<soap:Header>
    <axis2:ServiceGroupId xmlns:axis2="http://ws.apache.org/namespaces/axis2">
        urn:uuid:FA7EB13C84D91BC34B1373986557015
    </axis2:ServiceGroupId>
</soap:Header>
<soap:Body>
    ...
</soap:Body>

My soap header is :

<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns1=\"http://ws.dgpys.deloitte.com\">
<SOAP-ENV:Header>
    <ns1:ServiceGroupId>
        urn:uuid:FA7EB13C84D91BC34B1373986557015
    </ns1:ServiceGroupId>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
    ...
</SOAP-ENV:Body>

Mine doesn't work. I searched for a solution but I couldn't find anything. How can I fix this? Or which topics should I learn?

Sled
  • 18,541
  • 27
  • 119
  • 168
Muhammed Tanriverdi
  • 3,230
  • 1
  • 23
  • 24
  • 1
    Have you tried the one your producer suggested? – StephenTG Jul 17 '13 at 13:42
  • 1
    No, I couldnt generate producer's header. I use php and when i use setSoapHeaders($header); it creates mine soapheader – Muhammed Tanriverdi Jul 17 '13 at 13:45
  • Muhammed, how you can fix the issue? Please look my question: http://stackoverflow.com/questions/28737554/difference-between-two-soap-requests. I couldnt fix the issue. – Bora Feb 27 '15 at 12:44

1 Answers1

1

No, your http://schemas.xmlsoap.org/soap/envelope/ is SOAP 1.1 and requested is http://www.w3.org/2003/05/soap-envelope/, the SOAP 1.2 namespace.

Don't get confused by the soap/SOAP-ENV or axis/ns1, they are just namespace prefixes.

Also your first message seems to be missing the declaration of the axis2 namespace prefix, but I suppose xmlns:ws="http://ws.dgpys.deloitte.com" is meant to read xmlns:axis2="http://ws.dgpys.deloitte.com".

If the provider asks you to send SOAP 1.2, then use a SOAP 1.2 namespace and message format. This is why relevant code should be present in your question, but you need to instantiate your SoapClient like this:

$client = new SoapClient("some.wsdl", array('soap_version' => SOAP_1_2));
CodeCaster
  • 147,647
  • 23
  • 218
  • 272