ID:               49155
 User updated by:  jeroen at asystance dot nl
-Summary:          SoapServer sometimes passes parameters as null
 Reported By:      jeroen at asystance dot nl
 Status:           Open
 Bug Type:         SOAP related
 Operating System: linux
 PHP Version:      5.2SVN-2009-08-04 (snap)
 New Comment:

I have been able to further pin down the bug. The 2nd parameter is
passed as null if, in the <wsdl:message> definition, the 1st <wsdl:part>
element's name attribute is the same as the element attribute!

<wsdl:message name="someRequest">
  <wsdl:part name="customerId" element="tns:customerId"></wsdl:part>
  <wsdl:part name="fail" element="tns:customerId"></wsdl:part>
</wsdl:message>
Here the 1st parameter works, but the second is always null!

<wsdl:message name="someRequest">
  <wsdl:part name="cid" element="tns:customerId"></wsdl:part>
  <wsdl:part name="win" element="tns:customerId"></wsdl:part>
</wsdl:message>
Now both parameters work.


More generally, if one <wsdl:part> is specified in this way (name and
element are the same), _every other parameter_ is passed as null:

<wsdl:message name="someRequest">
  <wsdl:part name="p1" element="tns:customerId"></wsdl:part>
  <wsdl:part name="customerId" element="tns:customerId"></wsdl:part>
  <wsdl:part name="p3" element="tns:customerId"></wsdl:part>
</wsdl:message>
Here, p1 and p2 will be null, and customerId will work.

Happy bugfixing! :)


Previous Comments:
------------------------------------------------------------------------

[2009-08-04 14:47:58] jeroen at asystance dot nl

Description:
------------
I have a WSDL with three types: "customerId", "customer" and "order".

Calling a function with just a customer works, but a calling a function
with parameters (customerId, customer) does not - the customer parameter
is always null.

Another function, specified as (customerId, order), always works, so
the problem is not using more than one parameter (which could be a
problem since I'm using document/literal, and having more than one
message part does not conform to WS-I).

I have also tried switching the parameters and lots of other things but
I cannot find the underlying problem.

Reproduce code:
---------------
http://jayvee.nl/soaptest.tar

This includes a php file that runs a client as well as a server - so be
sure to change the service URL in interface.wsdl before you run this.

Expected result:
----------------
When SoapServer calls function addCustomer ( $p1, $p2 ), $p2 should be
a stdClass object (or array)

Actual result:
--------------
$p2 is null


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=49155&edit=1

Reply via email to