ID: 45284
Updated by: [EMAIL PROTECTED]
Reported By: pgiralt at cisco dot com
-Status: Assigned
+Status: Bogus
Bug Type: SOAP related
Operating System: Ubuntu Linux 8.04
PHP Version: 5.2.6
Assigned To: dmitry
New Comment:
ext/soap converts into sequence od elements only "plain" arrays (they
must contain only ordered numeric indexes starting from zero),
Just change your code, to produce array with indexes starting from 0
instead of 1, to make it work.
function AddMrgl($name, $members) {
$mrglData->name = $name;
$i = 0;
foreach($members as $member) {
$mrglData->members->member[$i]->mediaResourceGroupName = $member;
$mrglData->members->member[$i]->order = ++$i;
}
return $this->AddMrglData($mrglData);
}
Previous Comments:
------------------------------------------------------------------------
[2008-06-16 18:32:55] pgiralt at cisco dot com
Description:
------------
When an XSD file contains a sequence like this:
<xsd:complexType name="XMediaResourceGroup">
<xsd:sequence minOccurs="0">
<xsd:element name="name" type="axl:String50"/>
<xsd:element name="description" type="axl:String50"
minOccurs="0"/>
<xsd:element name="multicast" type="xsd:boolean"/>
<xsd:element name="members">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="member"
type="axl:XMediaResourceGroupMember"
maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="uuid" type="axl:XUUID"/>
</xsd:complexType>
<xsd:complexType name="XMediaResourceListMember">
<xsd:choice>
<xsd:element name="mediaResourceGroup"
type="axl:XMediaResourceGroup">
<xsd:annotation>
<xsd:documentation>Only the uuid
attribute is read by the AXL
API.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="mediaResourceGroupName"
type="axl:String50"/>
</xsd:choice>
<xsd:attribute name="uuid" type="axl:XUUID"/>
<xsd:attribute name="order" type="xsd:nonNegativeInteger"/>
</xsd:complexType>
When I include the array of members for the sequence in the
type XMediaResourceGroup, the PHP SOAP does not send the
sequence. See below for expected and actual results.
I have confirmed this works in 5.2.1 and is broken in 5.2.3, 5.2.4,
and 5.2.6. I am unable to test with 5.2.2 or 5.2.5.
The problem reported in 42723 seems similar, however that submitter
did not appear to describe the problem very well.
Reproduce code:
---------------
Reproduce code can be downloaded here:
http://www.employees.org/~pgiralt/phpbug2/phpbug.tar
Once untarred, run axl_test.php to reproduce the problem.
Included in the tarball is a directory that contains the SOAP
schema (axl60), file that contains a class (axlsoap.php) and the
script with the reproduction code (axl_test.php).
Expected result:
----------------
POST /axl/ HTTP/1.1
Host: 14.87.10.10:8443
Connection: Keep-Alive
User-Agent: PHP-SOAP/5.2.1
Content-Type: text/xml; charset=utf-8
SOAPAction: "addMediaResourceList"
Content-Length: 595
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://www.cisco.com/AXL/API/1.0">
<SOAP-ENV:Body>
<ns1:addMediaResourceList>
<mediaResourceList>
<name>TestMRGL</name>
<members>
<member order="1">
<mediaResourceGroupName>Member1</mediaResourceGroupName>
</member>
<member order="2">
<mediaResourceGroupName>Member2</mediaResourceGroupName>
</member>
<member order="3">
<mediaResourceGroupName>Member3</mediaResourceGroupName>
</member>
</members>
</mediaResourceList>
</ns1:addMediaResourceList>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Actual result:
--------------
POST /axl/ HTTP/1.1
Host: 14.87.10.10:8443
Connection: Keep-Alive
User-Agent: PHP-SOAP/5.2.6-1ubuntu1
Content-Type: text/xml; charset=utf-8
SOAPAction: "addMediaResourceList"
Content-Length: 355
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://www.cisco.com/AXL/API/1.0">
<SOAP-ENV:Body>
<ns1:addMediaResourceList>
<mediaResourceList>
<name>TestMRGL</name>
<members>
<member/>
</members>
</mediaResourceList>
</ns1:addMediaResourceList>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45284&edit=1