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

 ID:                 49155
 User updated by:    jeroen at asystance dot nl
 Reported by:        jeroen at asystance dot nl
 Summary:            SoapServer passes parameters as null if one has
                     special wsdl definition
 Status:             Open
 Type:               Bug
 Package:            SOAP related
 Operating System:   linux
-PHP Version:        5.2SVN-2009-08-04 (snap)
+PHP Version:        5.3.3
 Block user comment: N
 Private report:     N

 New Comment:

Just wanted to verify that this bug is still present in 5.3.3


Previous Comments:
------------------------------------------------------------------------
[2009-08-05 12:22:29] jeroen at asystance dot nl

Sorry for posting yet another comment, but it gets even weirder:



<wsdl:message name="someRequest">

  <wsdl:part name="customerId" element="tns:customerId"></wsdl:part>

  <wsdl:part name="customerDetails" element="tns:customer"></wsdl:part>

</wsdl:message>

This will not work, because in the first part, the name==element



However,

<wsdl:message name="someRequest">

  <wsdl:part name="customerId" element="tns:customerId"></wsdl:part>

  <wsdl:part name="customer" element="tns:customer"></wsdl:part>

</wsdl:message>

_will_ work! Notice that now both parts are specified with
name==element!





My conclusion so far is that either _all_ of the parts need to be
specified with the name==element pattern, or _none_. If one of the parts
uses the pattern, the rest needs to conform, or else the SoapServer
passes them as null.



I sure hope this helps! I've been struggling with this for a while now.

------------------------------------------------------------------------
[2009-08-05 11:53:25] jeroen at asystance dot nl

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! :)

------------------------------------------------------------------------
[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/bug.php?id=49155&edit=1

Reply via email to