ID: 40318
Updated by: [EMAIL PROTECTED]
Reported By: bink at eezi dot net dot au
-Status: Open
+Status: Assigned
Bug Type: SOAP related
Operating System: Redhat
PHP Version: 5.2.0
-Assigned To:
+Assigned To: dmitry
Previous Comments:
------------------------------------------------------------------------
[2007-02-02 06:31:12] bink at eezi dot net dot au
The Namespaces on the Actual result are incorrect, they should match up
with the Expected result....
------------------------------------------------------------------------
[2007-02-02 06:05:27] bink at eezi dot net dot au
Description:
------------
Possibly a documentation issue
=====================================
When using a php object to create SOAP request headers, the
SoapVAR($obj, SOAP_ENC_OBJECT....) and SoapHeader($namespace, $name,
$soapvar) does not set the namespace of the object properties to the
same as the object itself.
Reproduce code:
---------------
$client = new SOAPClient($wsdl, array('trace' => '1'));
class headers {
function __construct($val1, $val2){
$this->val1 = $val1;
$this->val2 = $val2;
}
}
$obj = new headers('val1','val2');
$svval=new SoapVar($obj,SOAP_ENC_OBJECT, NULL, NULL, "",
"http://url.com/namespace2");
$header = new SoapHeader("http://url.com/namespace2",
"SoapHeaderMsg",
$svval, false);
$client->__setSoapHeaders(array($header));
$client->ping();
print_r($client->__getLastRequest());
Expected result:
----------------
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://url.com/namespace1"
xmlns:ns2="http://url.com/namespace2">
<SOAP-ENV:Header>
<ns2:SoapHeaderMsg>
<ns2:val1>val1</val1>
<ns2:val2>val2</val2>
</ns2:SoapHeaderMsg>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns1:PingRequest/>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Actual result:
--------------
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://ow.optus.com.au/b2b/bwsgservices/schema/version/2.0/bilpm"
xmlns:ns2="http://ow.optus.com.au/b2b/xwsgservices/schema/wscommon">
<SOAP-ENV:Header>
<ns2:SoapHeaderMsg>
<val1>val1</val1>
<val2>val2</val2>
</ns2:SoapHeaderMsg>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns1:PingRequest/>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40318&edit=1