I'm trying to make SOAP petitions where there must be an Addressing parameter declared inside the Header.
Here's my code in PHP:
$params = array();
$params['xmlns:tem'] = "http://tempuri.org/";
$params['soap_version'] = SOAP_1_2;
$params['trace'] = 1;
$client = new SoapClient("myurl",$params);
$header = array();
$header[] = new SoapHeader('http://www.w3.org/2005/08/addressing', "Action", "myurlAction");
$header[] = new SoapHeader('http://www.w3.org/2005/08/addressing', "To", "myurlTo");
$client->__setSoapHeaders($header);
$result = $client->myCall()
To get the results, I have to declare the wsa inside the header like this (notice the ns2 parameter declared in Header):
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://tempuri.org/">
<env:Header xmlns:ns2="http://www.w3.org/2005/08/addressing">
....
</env:Header>
The avobe XML returns the data, so it's what I want the php to generate.
But with my PHP code I get this result (the parameter ns2 is declared in the Envelope instead):
<env:Envelope
xmlns:env="http://www.w3.org/2003/05/soap-envelope"
xmlns:ns1="http://tempuri.org/"
xmlns:ns2="http://www.w3.org/2005/08/addressing">
<env:Header> ... </env:Header>
How can I achieve this?
Thank you...