Domanda

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?

È stato utile?

Soluzione

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));
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top