in reply to Re^4: SOAP::Lite, .NET, and complex structures
in thread SOAP::Lite, .NET, and complex structures
Update:
package Wholesale::Addon; =begin WSDL _ATTR productid $int doc for attr. _ATTR name $string doc for attr. _ATTR description $string doc for attr. _ATTR price $int doc for attr. _ATTR windowIncr $int doc for attr. _ATTR computerIncr $int doc for attr. _ATTR deferred $boolean doc for attr. _ATTR addonid $int doc for attr. _ATTR added $dateTime doc for attr. _ATTR username $string doc for attr. =end WSDL =cut sub new { my $class = shift; my ($productid, $name, $description, $price, $windowIncr, $computerIncr, $deferred, $addonid, $added, $username) = @_; bless { productid => $productid, name => $name, description => $description, price => $price, windowIncr => $windowIncr, computerIncr => $computerIncr, deferred => $deferred, addonid => $addonid, added => $added, username => $username }, $class; } #... methods omitted for brevity. 1;
<complexType name="WholesaleAddon"> <sequence> <element name="productid" nillable="true" type="xsd:int"> <wsdl:documentation>doc for attr.</wsdl:documentation> </element> <element name="name" nillable="true" type="xsd:string"> <wsdl:documentation>doc for attr.</wsdl:documentation> </element> <element name="description" nillable="true" type="xsd:string"> <wsdl:documentation>doc for attr.</wsdl:documentation> </element> <element name="price" nillable="true" type="xsd:int"> <wsdl:documentation>doc for attr.</wsdl:documentation> </element> <element name="windowIncr" nillable="true" type="xsd:int"> <wsdl:documentation>doc for attr.</wsdl:documentation> </element> <element name="computerIncr" nillable="true" type="xsd:int"> <wsdl:documentation>doc for attr.</wsdl:documentation> </element> <element name="deferred" nillable="true" type="xsd:boolean"> <wsdl:documentation>doc for attr.</wsdl:documentation> </element> <element name="addonid" nillable="true" type="xsd:int"> <wsdl:documentation>doc for attr.</wsdl:documentation> </element> <element name="added" nillable="true" type="xsd:dateTime"> <wsdl:documentation>doc for attr.</wsdl:documentation> </element> <element name="username" nillable="true" type="xsd:string"> <wsdl:documentation>doc for attr.</wsdl:documentation> </element> </sequence> </complexType>
package Wholesale; use Wholesale::Addon; # other methods ommitted for brevity =begin WSDL _DOC doc for method. _IN username $string doc for param. _RETURN @Wholesale::Addon doc for returnval. =end WSDL =cut sub list_attached_addons { # process arguments my $self = shift; my ($username) = @_; my @addons; # <snip> # construct a list of Wholesale::Addon objects # here using Wholesale::Addon->new(...) passing # data retrieved from the database. # </snip> return @addons; } 1;
<wsdl:operation name="list_attached_addons" parameterOrder="username"> <wsdl:documentation>doc for method.</wsdl:documentation> <wsdl:input message="impl:list_attached_addonsRequest" name="list_at +tached_addonsRequest" /> <wsdl:output message="impl:list_attached_addonsResponse" name="list_ +attached_addonsResponse" /> </wsdl:operation> <wsdl:operation name="list_attached_addons"> <wsdlsoap:operation soapAction="" /> <wsdl:input name="list_attached_addonsRequest"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/enco +ding/" namespace="http://127.0.0.1:2233/Wholesale" use="encoded" /> </wsdl:input> <wsdl:output name="list_attached_addonsResponse"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/enco +ding/" namespace="http://127.0.0.1:2233/Wholesale" use="encoded" /> </wsdl:output> </wsdl:operation> <wsdl:message name="list_attached_addonsRequest"> <wsdl:part name="username" type="xsd:string"> <wsdl:documentation>doc for param.</wsdl:documentation> </wsdl:part> </wsdl:message> <wsdl:message name="list_attached_addonsResponse"> <wsdl:part name="list_attached_addonsReturn" type="tns1:ArrayOfWhole +saleAddon"> <wsdl:documentation>doc for returnval.</wsdl:documentation> </wsdl:part> </wsdl:message> <complexType name="ArrayOfWholesaleAddon"> <complexContent> <restriction base="soapenc:Array"> <attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:Wholesal +eAddon[]" /> </restriction> </complexContent> </complexType>
Are you doing anything terribly more complicated than that?
-David.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: SOAP::Lite, .NET, and complex structures
by MidLifeXis (Monsignor) on Aug 16, 2007 at 15:15 UTC | |
by erroneousBollock (Curate) on Aug 16, 2007 at 16:42 UTC |