|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-11-03 10:51 UTC] 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.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 07:00:01 2025 UTC |
So sad, I met this problem. Anyone can help me? php version information is: PHP 7.1.14 (cli) (built: Feb 7 2018 18:33:30) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies details in wsdl: <xs:complexType name="organizationResponse"> <xs:sequence> <xs:element minOccurs="0" name="code" type="xs:string"/> <xs:element minOccurs="0" name="errorInfo" type="xs:string"/> <xs:element minOccurs="0" name="msg" type="xs:string"/> <xs:element maxOccurs="unbounded" minOccurs="0" name="result" nillable="true" type="tns:organizationReturnDetails"/> </xs:sequence> </xs:complexType> <xs:complexType name="organizationReturnDetails"> <xs:sequence> <xs:element minOccurs="0" name="financeOrgName" type="xs:string"/> <xs:element minOccurs="0" name="orgAssociate" type="xs:string"/> <xs:element minOccurs="0" name="orgCode" type="xs:string"/> <xs:element name="orgId" type="xs:int"/> <xs:element minOccurs="0" name="orgName" type="xs:string"/> <xs:element minOccurs="0" name="orgNamePy" type="xs:string"/> <xs:element name="orgType" type="xs:int"/> <xs:element minOccurs="0" name="parentFinanceOrgName" type="xs:string"/> <xs:element name="parentOrgAssociate" type="xs:int"/> <xs:element minOccurs="0" name="parentOrgCode" type="xs:string"/> <xs:element name="parentOrgId" type="xs:int"/> <xs:element minOccurs="0" name="parentOrgName" type="xs:string"/> <xs:element minOccurs="0" name="parentOrgNamePy" type="xs:string"/> <xs:element name="parentOrgType" type="xs:int"/> </xs:sequence> </xs:complexType> The error: Fatal error: Uncaught SoapFault exception: [Client] SOAP-ERROR: Encoding: object has no 'orgAssociate' property in /Users/taoli/php-workspace/vendor/zendframework/zend-soap/src/Client.php:1166 Stack trace: #0 /Users/taoli/php-workspace/vendor/zendframework/zend-soap/src/Client.php(1166): SoapClient->__soapCall('getOrganization', Array, Array, Array, Array) #1 /Users/taoli/php-workspace/soap.php(30): Zend\Soap\Client->__call('getOrganization', Array) #2 {main} thrown in /Users/taoli/php-workspace/vendor/zendframework/zend-soap/src/Client.php on line 1166