Bug #53234 [Opn->Fbk]: "SOAP-ERROR: Encoding: object hasn't 'xxx' property" for xsd-choice element

From: Date: Wed, 27 May 2015 21:07:39 +0000
Subject: Bug #53234 [Opn->Fbk]: "SOAP-ERROR: Encoding: object hasn't 'xxx' property" for xsd-choice element
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-192936@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=53234&edit=1

 ID:                 53234
 Updated by:         cmb@php.net
 Reported by:        vadim dot sacharow at pali dot de
 Summary:            "SOAP-ERROR: Encoding: object hasn't 'xxx' property"
                     for xsd-choice element
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            SOAP related
 Operating System:   Windows XP
 PHP Version:        5.2.14
-Assigned To:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

Bug #50997 has been fixed since a long time. Can this ticket also
be closed, Vadim?


Previous Comments:
------------------------------------------------------------------------
[2010-11-03 14:06:05] vadim dot sacharow at pali dot de

Some new information: the problem occurs, if the first element of the choice-group is a xs:sequence.
If the first element is a xs:element (xs:sequence as second element), then everything works fine.

------------------------------------------------------------------------
[2010-11-03 10:54:11] vadim dot sacharow at pali dot de

The bug 50997 seems to describe the same problem

------------------------------------------------------------------------
[2010-11-03 10:51:44] vadim dot sacharow at pali dot de

Description:
------------
I have the following xsd-part:
<xs:choice>
    <xs:sequence>
	<xs:element name="Company">
	    <xs:complexType>
		<xs:complexContent>
			<xs:extension base="Company"/>
		</xs:complexContent>
	    </xs:complexType>
	</xs:element>
	<xs:element name="ContactPerson" type="Person" minOccurs="0">
	</xs:element>
    </xs:sequence>
    <xs:element name="Person" type="Person">
    </xs:element>
</xs:choice>

Its a choice-element. I expect, that my request must have just one of following two elements:
a. sequence of Company and ContactPerson
b. Person

But when i try to send a request, that has a Person, i get the SOAP-ERROR: Encoding: object
hasn't 'Company' property

If i change the places of a and b in wsdl definition file - everything works perfect with Person.

I think, that SoapClient working in wsdl-mode doesn't understand the choice-element in the
right way. SoapClient just takes the first one and says, that this element is required - but its
false, because just one of the both (a or b) is required, and not the first element in the
choice-group.



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=53234&edit=1


Thread (8 messages)

« previous php.bugs (#192936) next »