[SOAP]Problem with namespace in Soap Header
am 17.01.2008 15:43:22 von fragmonsterHi,
I have a .NET Web Service.
I must write a client in PHP5. I've got a problem with the formatting
of my SoapHeader. In fact, the prefix of the namespace does not apply
to the entire header node and child nodes:
Here is my PHP Soap message :
===========================
===========================
As you can see, the ns1 prefix which appears in
does not be inherited in UID and Site. Thats why my .NET web method
cannot get the UID and Site values.
Here is my PHP code :
===========================
class AuthHeaderGuidSite {
private $UID;
private $Site;
public function __construct($uid,$site) {
$this->UID=$uid;
$this->Site=$site;
}
}
$ns = "http://www.toto.com/";
$client = new SOAPClient($wsdl,$options);
$GUID = "xxx";
$site = 102;
$Auth1 = new AuthHeaderUidSite($GUID,$site);
$headerBody = new SOAPVar($Auth1,SOAP_ENC_OBJECT);
$header = new SoapHeader($ns,'AuthHeaderUidSite',$headerBody,false);
$day = date('Y-m-d\TH:i:s');
$params = array("nom"=>"LI", "day"=>$day);
$s = $client -
>__soapCall("HelloWorld",array($params),NULL,array($header)) ;
============================
How can I do to make this namespace appears in the entire Header tag
like this :
(I test this envelop with an external tool and it works)
Thank you