php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35142 SOAP Client/Server Complex Object Support
Submitted: 2005-11-07 18:47 UTC Modified: 2005-11-08 22:04 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: matt dot jones at plumgroup dot com Assigned: dmitry (profile)
Status: Closed Package: SOAP related
PHP Version: 5CVS-2005-11-07 (snap) OS: *
Private report: No CVE-ID: None
 [2005-11-07 18:47 UTC] matt dot jones at plumgroup dot com
Description:
------------
When implementing a function to handle a soap request in a SoapServer the object that is returned has a specific and obvious structure.  It is an object with basic typed members to represent the attributes and one or more complex objects (or an array of objects) for subtags which are built as a similar sort of object.

What I am proposing would be to allow for this same complex object structure to be passed in and parsed by both the SoapClient->{function()} and to be returned by the functions specified to handle the soap request for the SoapServer.

Reproduce code:
---------------
The following is some partial source code that represents how I would like to see objects supported in the client-side:

http://roberts.plumgroup.com/~mjones/soapclient.txt

You can see that there are multiple classes created to contruct the request.  The code makes use of both single objects and arrays of objects to create a complex request.  You can find a version of the WSDL that this is partially implementing here:

http://roberts.plumgroup.com/~mjones/test.wsdl

Expected result:
----------------
The system should be able to accept this format for incoming objects to properly create a complex soap request such as:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testurl/Message">
    <SOAP-ENV:Body>
        <ns1:ivrEvents activityId="101" messageId="12345" source="IVR" version="1.0">
            <logOnEvent audienceMemberId="34567" timestamp="2005-11-07T12:27:33"/>
            <logOffEvent audienceMemberId="34568" timestamp="2005-11-07T12:27:33" smokeStatus="Smoked" callInitiator="IVR"/>
            <logOffEvent audienceMemberId="34569" timestamp="2005-11-07T12:27:33" smokeStatus="SmokeFree" callInitiator="IVR"/>
        </ns1:ivrEvents>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

This is the format it chooses for objects sent to SoapServer handler functions, it should support it for SoapClient function calls.

Actual result:
--------------
With the above code the current implementation properly creates the logOnEvent subtag and stops there no logOffEvents are added.  If you attempt to add multiple logOnEvents alone in an array they are not properly added as multiple logOnEvents either.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-07 21:39 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip


 [2005-11-08 00:07 UTC] matt dot jones at plumgroup dot com
I have tested this with php5-win32-latest.zip (it was easier than recompiling for linux) and I am seeing the exact same behavior.  Providing an array of objects is not interpreted properly and having more than one subtag object results in the first tag to appear in the WSDL being the only response.
 [2005-11-08 00:54 UTC] sniper@php.net
Assigned to the maintainer of ext/soap
 [2005-11-08 09:37 UTC] dmitry@php.net
Fixed in CVS HEAD and PHP_5_1.
 [2005-11-08 22:04 UTC] matt dot jones at plumgroup dot com
Thanks, this works perfectly!  Just a heads up to people using this patch though:

You must clear out your WSDL cache for the patch to override the previous incorrect behavior.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 02:01:28 2024 UTC