php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39406 Wrong namespaces in SOAP request
Submitted: 2006-11-06 20:03 UTC Modified: 2006-11-07 14:06 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: mail at martin-probst dot com Assigned:
Status: Not a bug Package: SOAP related
PHP Version: 5.2.0 OS: MacOS
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mail at martin-probst dot com
New email:
PHP Version: OS:

 

 [2006-11-06 20:03 UTC] 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>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-06 20:19 UTC] mail at martin-probst dot com
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.
 [2006-11-07 14:06 UTC] mail at martin-probst dot com
Turns out this is (most likely) not a problem with the PHP 
SOAP implementation, sorry to bother you.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Mar 22 12:01:27 2019 UTC