|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49155 SoapServer passes parameters as null if one has special wsdl definition
Submitted: 2009-08-04 14:47 UTC Modified: 2013-10-15 12:34 UTC
Avg. Score:3.9 ± 1.4
Reproduced:6 of 6 (100.0%)
Same Version:2 (33.3%)
Same OS:5 (83.3%)
From: jeroen at asystance dot nl Assigned:
Status: Open Package: SOAP related
PHP Version: 5.3.3 OS: linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2009-08-04 14:47 UTC] jeroen at asystance dot nl
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:

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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-08-05 11:53 UTC] 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>
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>
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>
Here, p1 and p2 will be null, and customerId will work.

Happy bugfixing! :)
 [2009-08-05 12:22 UTC] 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>
This will not work, because in the first part, the name==element

<wsdl:message name="someRequest">
  <wsdl:part name="customerId" element="tns:customerId"></wsdl:part>
  <wsdl:part name="customer" element="tns:customer"></wsdl:part>
_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.
 [2011-02-11 12:25 UTC] jeroen at asystance dot nl
-PHP Version: 5.2SVN-2009-08-04 (snap) +PHP Version: 5.3.3
 [2011-02-11 12:25 UTC] jeroen at asystance dot nl
Just wanted to verify that this bug is still present in 5.3.3
 [2012-04-26 08:30 UTC] nicolodien at gmx dot de
Hi everybody

I just want to confirm that this is still an issue! I've spent more than 3 hours debugging until I finally found this bug description giving me a solution. 

Please DO fix this problem...
 [2013-08-02 04:26 UTC]
-Status: Open +Status: Feedback
 [2013-08-02 04:26 UTC]
Please try using this snapshot:
For Windows:

I see several fixes in soap module. Could you try 5.4?
 [2013-08-02 15:04 UTC] jeroen at asystance dot nl
Still not fixed in PHP 5.4.19-dev
 [2013-08-05 08:02 UTC] jeroen at asystance dot nl
I just tested 5.5.2-dev as well: fails.
 [2013-10-15 11:54 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 [2013-10-15 12:31 UTC] jeroen at asystance dot nl
-Summary: SoapServer passes parameters as null if one has special wsdl definition +Summary:
 [2013-10-15 12:31 UTC] jeroen at asystance dot nl
I don't understand why this bug was closed.

I tested in 5.4 and 5.5. What else is needed? Is it because I posted the test results as in the "add comment" tab, instead of the "edit" tab?
 [2013-10-15 12:34 UTC] jeroen at asystance dot nl
-Summary: +Summary: SoapServer passes parameters as null if one has special wsdl definition -Status: +Status: Open
 [2013-10-15 12:34 UTC] jeroen at asystance dot nl
Sorry, LastPass butchered the summary in my last update.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 24 12:01:28 2024 UTC