Re: [SOAP] Re: Passing objects to soap server, complexType, classmap
| From: | Morgan Pyne | Date: | Wed, 21 Jun 2006 01:59:02 +0000 |
| Subject: | Re: [SOAP] Re: Passing objects to soap server, complexType, classmap | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.soap |
| Request: | Send a blank email to php-soap+get-2330@lists.php.net to get a copy of this message | ||
Michael Rasmussen wrote:
On Wed, 21 Jun 2006 11:06:49 +1200, Morgan Pyne wrote:No problem, I've pasted it in below. Hope the formatting survives. Note that if there are any problems with it, don't blame George(!) - I had to modify his code slightly to ignore static properties and make it aware of booleans. I'm curious to see if your curiosity finds anything curious about this WSDL :-) Cheers, Morgan <?xml version="1.0"?> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://localhost/soap" xmlns:soap-env="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" targetNamespace="http://localhost/soap"> <types>The two noticeable differences between your sample and my code are: 1) My complexType truly is a pretty complex type (a subclass of an auto-generated object built from a database table created by Symfony/Propel, with properties including arrays of objects :-) 2) My WSDL file is auto-generated from my SOAP server class using some example code posted by George Schlossnagel.Just for my curiosity, could you post the WSDL?
<xsd:schema>
<xsd:complexType name="array">
<xsd:complexContent>
<xsd:restriction base="soapenc:array">
<xsd:attribute ref="soapenc:arrayType" arrayType="tns:mixed[]"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<complexType name="mixed">
<all>
<element name="varString" type="xsd:string"/>
<element name="varInt" type="xsd:int"/>
<element name="varFloat" type="xsd:float"/>
<element name="varArray" type="tns:array"/>
</all>
</complexType>
<complexType name="VnCurrency">
<all>
<element name="currency_id" type="xsd:string"/>
<element name="currency_symbol_html" type="xsd:string"/>
<element name="currency_name" type="xsd:string"/>
<element name="collVnBookings" type="tns:array"/>
<element name="collVnCashTransactions" type="tns:array"/>
<element name="collVnCcTransactions" type="tns:array"/>
<element name="collVnRates" type="tns:array"/>
<element name="alreadyInSave" type="xsd:boolean"/>
<element name="alreadyInValidation" type="xsd:boolean"/>
<element name="validationFailures" type="tns:array"/>
<element name="modifiedColumns" type="tns:array"/>
</all>
</complexType>
</xsd:schema>
</types>
<message name="passMeAnObjectInput">
<part name="obj" type="tns:VnCurrency"/></message> <message name="passMeAnObjectOutput">
<part name="return" type="xsd:string"/></message> <portType name="TestSoapServerPortType">
<operation name="passMeAnObject">
<input message="tns:passMeAnObjectInput"/>
<output message="tns:passMeAnObjectOutput"/>
</operation></portType> <binding name="TestSoapServerBinding" type="tns:TestSoapServerPortType">
<soap-env:binding xmlns="http://schemas.xmlsoap.org/wsdl/soap/" style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/" name="passMeAnObject"> <input xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/"> <soap-env:body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/">
<soap-env:body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation></binding> <service name="TestSoapServerService">
<port xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/" name="TestSoapServerPort" binding="tns:TestSoapServerBinding"> <soap-env:address xmlns="http://schemas.xmlsoap.org/wsdl/soap/" location="http://localhost/soap"/> </port></service> </definitions>