Edit report at https://bugs.php.net/bug.php?id=50997&edit=1
ID: 50997
Comment by: duccio at citta dot bo dot it
Reported by: mrsharp at gmx dot de
Summary: SOAP Error when trying to submit 2nd Element of a
choice
Status: Open
Type: Bug
Package: SOAP related
Operating System: debian
PHP Version: 5.2.12
Block user comment: N
Private report: N
New Comment:
It's not really a solution to the bug, but it does make it work. In the passed
parameters, define all the fields he's claiming as "Missing property".
So if you're using an array, and it says it's missing property 'GetData', do:
$requestArray['GetData'] = '';
and so on with each field, until it's working.
Previous Comments:
------------------------------------------------------------------------
[2012-04-11 11:34:16] christian dot achatz at payback dot net
This issue is also reproducable for PHP 5.3.8. It would be kind to fix it very
soon.
------------------------------------------------------------------------
[2011-05-17 11:09:02] yozik04 at gmail dot com
I can reproduce this with PHP version 5.3.5 in Ubuntu.
Moving element around in xsd is not a solution for me.
Is there any other workaround available without touching WSDL and XSD?
------------------------------------------------------------------------
[2010-07-13 12:56:49] sebastian at rootdir dot ws
As this still seems to be an issue, here is a complete reproducer:
$soapClient = new SoapClient('service2.wsdl', array ('trace' => 1));
$params = array('code' => 'foo');
$soapClient->newOperation($params);
WSDL excerpt:
<xsd:element name="NewOperation">
<xsd:complexType>
<xsd:choice>
<xsd:sequence>
<xsd:element name="firstName" type="xsd:string"> </xsd:element>
<xsd:element name="surName" type="xsd:string"/>
</xsd:sequence>
<xsd:element name="code" type="xsd:string"/></xsd:choice>
</xsd:complexType>
</xsd:element>
(You can find the whole WSDL example file over at http://pastebin.com/UZrPCuJt)
Actual result:
Fatal error: SOAP-ERROR: Encoding: object hasn't 'firstName' property
If you move element name "code" being the first child of <xsd:choice> the code
snippet above is working as expected.
------------------------------------------------------------------------
[2010-02-11 10:22:36] mrsharp at gmx dot de
Tested also using PHP Version 5.2.5-3 same result....
------------------------------------------------------------------------
[2010-02-10 18:08:41] mrsharp at gmx dot de
Description:
------------
My Actual PHP Version: PHP Version 5.2.11-0.dotdeb.0
not 100% sure if this relates to Bug #43723: "SOAP not sent properly from
client for <choice>" because SOAP is not sent at all in my scenario (Fatal
Error)
Part of my WSDL is this schema excerpt
<xsd:complexType name="sometype">
<xsd:choice>
<xsd:group ref="sd:someGroupDefA"/>
<xsd:group ref="sd:someGroupDefB"/>
</xsd:choice> ....
A SOAP operation now employs this type... if I attempt to submit a property set
which resembles "someGroupDefB" I receive a
SOAP-ERROR: Encoding: object hasn't someGroupDefA property
so it seems that choice is not properly evalutated...
Expected result:
----------------
I expect that SOAP accepts both sets of parameters without complaining about
the other missing...
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=50997&edit=1