SOAP Header with php5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

with PEAR SOAP I was able to generate a SOAP-Header with
the following code:

$auth_header = new SOAP_Header('authenticate','Struct',array('username'=>'testuser','password'=>'test12345'),0);

And then use addHeader() to put it into the SOAP-Client object,
so the result is more or less something like:

<SOAP-ENV:Header>
 <authenticate SOAP-ENV:mustUnderstand="0"
 SOAP-ENV:actor="http://schemas.xmlsoap.org/soap/actor/next";>
     <password xsi:type="xsd:string">test12345</password>
     <username xsi:type="xsd:string">testuser</username>
  </authenticate>
</SOAP-ENV:Header>

With php5 I wasn't that successfull. In the manual it says:
SoapVar::SoapVar ( mixed data, int encoding [, string type_name [, string type_namespace [, string node_name [, string node_namespace]]]])


$auth_header=new SoapHeader(null,"authenticate",
      array(
        new SoapVar("testuser",XSD_STRING,"username"),
        new SoapVar("test12345",XSD_STRING,"password")),
      false,
      "http://schemas.xmlsoap.org/soap/actor/next";);

But the result is:

<SOAP-ENV:Header>
   <ns2:authenticate
   SOAP-ENV:actor="http://schemas.xmlsoap.org/soap/actor/next";>
     <item>testuser</item>
     <item>test12345</item>
   </ns2:authenticate>
</SOAP-ENV:Header>

Whenever I put more parameters into SoapVar, it doesn't change anything.
What do I have to change in the auth_header to make it look behave
like the constructor in the PEAR implementation?

--
Nils Sowen
Softwareengineer

KOMPLEX.NET GmbH
Bismarckstrasse 120
D-47057 Duisburg

Fon: 0203 3094 428
Fax: 0203 3094 110

http://www.freecity.de
http://www.kontent.de
http://www.komplex.net
http://www.kon.de

--
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux