#39406 [Opn]: Wrong namespaces in SOAP request
| From: | mail at martin-probst dot com | Date: | Mon, 06 Nov 2006 20:19:03 +0000 |
| Subject: | #39406 [Opn]: Wrong namespaces in SOAP request | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-104486@lists.php.net to get a copy of this message | ||
ID: 39406
User updated by: mail at martin-probst dot com
Reported By: mail at martin-probst dot com
Status: Open
Bug Type: SOAP related
Operating System: MacOS
PHP Version: 5.2.0
New Comment:
Btw.: Bug #36547 seems related
And: http://de3.php.net/manual/en/ref.soap.php#69173
seems to
refer to the same bug, providing a really weird and dirty
work-around.
Previous Comments:
------------------------------------------------------------------------
[2006-11-06 20:03:36] mail at martin-probst dot com
Description:
------------
I'm trying to access a web service using a .wsdl file, literal
style. The wsdl defines two schemata with different namespaces
where the first one refers to the latter. The message
parameter in the SOAP envelope gets the wrong namespace.
Reproduce code:
---------------
The wsdl contains two schemata:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl"
xmlns:xi0="http://targetNS" xmlns:xi1="http://otherNS"
targetNamespace="http://targetNS">
<xsd:import namespace="http://otherNS"/>
<xsd:element name="EmployeeBasicDataByEmployeeQuery"
type="xi1:EmployeeBasicDataByEmployeeQueryMessage"/>
...
</xsd:schema>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl"
xmlns:xi0="http://targetNS" xmlns:xi1="http://otherNS"
xmlns="http://otherNS" targetNamespace="http://otherNS">
<xsd:complexType name="EmployeeBasicDataByEmployeeQueryMessage">
<xsd:sequence>
<xsd:element name="EmployeeBasicDataSelectionByEmployee">
...
</xsd:schema>
The calling PHP code:
$res = $soap->EmployeeBasicDataByEmployeeQueryResponse_In(
array("EmployeeBasicDataSelectionByEmployee" => array("EmployeeID"
=> 10))));
echo $soap->__getLastRequest() . "\n";
I also tried classmaps and various array combinations. If you add
another array level (EmployeeBasicDataByEmployeeQuery) the above gives
an error (object hasn't 'EmployeeBasicDataSelectionByEmployee'
property).
Expected result:
----------------
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/
soap/envelope/"
xmlns:ns1="http://targetNS"
xmlns:ns2="http://otherNS">
<SOAP-ENV:Body>
<ns1:EmployeeBasicDataByEmployeeQuery>
<ns2:EmployeeBasicDataSelectionByEmployee>
<ns2:EmployeeID>10</ns2:EmployeeID>
</ns2:EmployeeBasicDataSelectionByEmployee>
</ns1:EmployeeBasicDataByEmployeeQuery>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Actual result:
--------------
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/
soap/envelope/"
xmlns:ns1="http://my/namespace/somewhere">
<SOAP-ENV:Body>
<ns1:EmployeeBasicDataByEmployeeQuery>
<EmployeeBasicDataSelectionByEmployee>
<EmployeeID>10</EmployeeID>
</EmployeeBasicDataSelectionByEmployee>
</ns1:EmployeeBasicDataByEmployeeQuery>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39406&edit=1