From:             mail at martin-probst dot com
Operating system: MacOS
PHP version:      5.2.0
PHP Bug Type:     SOAP related
Bug description:  Wrong namespaces in SOAP request

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 bug report at http://bugs.php.net/?id=39406&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=39406&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=39406&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=39406&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=39406&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=39406&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=39406&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=39406&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=39406&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=39406&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=39406&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=39406&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=39406&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=39406&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=39406&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=39406&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=39406&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=39406&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=39406&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=39406&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=39406&r=mysqlcfg

Reply via email to