Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > soap complex type example

Reply
Thread Tools

soap complex type example

 
 
Francois Paul
Guest
Posts: n/a
 
      08-14-2006
Hi,

i've got very limited soap experience and i'm currently stuck on how to
get a ruby soap client up and running.

the wsdl of the service i am trying to access is here:
https://www.encryptedserver2.com/alt...vice.asmx?WSDL

and the specific method i want to call looks like this:

<s:element name="PlaceOrderV1">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="StorefrontID" type="s:int"/>
<s:element minOccurs="0" maxOccurs="1" name="Username" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Password" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="AccessPwd" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="PlaceOrderRequest"
nillable="true" type="tnslaceOrderRequest"/>
</s:sequence>
</s:complexType>
</s:element>

<s:complexType name="PlaceOrderRequest">

<s:complexContent mixed="false">

<s:extension base="tns:BaseRequest">

<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="StorefrontOrderID"
type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="ShipToFirstName"
type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="ShipToMiddleName"
type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="ShipToLastName"
type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="ShipToAddress"
type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="ShipToAddress2"
type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="ShipToCity" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="ShipToState" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="ShipToZip" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="ShipToCountryID" type="s:int"/>
<s:element minOccurs="0" maxOccurs="1" name="ShipToPhone" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="ShipToEmail" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="BillToFirstName"
type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="BillToMiddleName"
type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="BillToLastName"
type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="BillToAddress"
type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="BillToAddress2"
type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="BillToCity" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="BillToState" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="BillToZip" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="BillToCountry"
type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="BillToPhone" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="BillToEmail" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="ShipMethodID" type="s:int"/>
<s:element minOccurs="0" maxOccurs="1" name="LineItemArray"
type="tns:ArrayOfLineItem"/>
</s:sequence>
</s:extension>
</s:complexContent>
</s:complexType>

<s:complexType name="ArrayOfLineItem">

<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="LineItem"
nillable="true" type="tns:LineItem"/>
</s:sequence>
</s:complexType>

<s:complexType name="LineItem">

<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="ProductID" type="s:int"/>
<s:element minOccurs="1" maxOccurs="1" name="Qty" type="s:int"/>
</s:sequence>
</s:complexType>

from various simple examples i get this far:
wsdl_url =
"https://www.encryptedserver2.com/alturawebservicedev/storewebservice.asmx?WSDL"
soap = SOAP::WSDLDriverFactory.new(wsdl_url).create_rpc_d river
soap.wiredump_file_base = "soapresult"

param = {
'StorefrontID' => '112',
'Username' => 'wszaadz',
'Password' => 'wsdev',
'AccessPwd' => 'zaadzda',
}
result = soap.PlaceOrderV1(param)

but i can't for the life of me figure out how to send the values for
the PlaceOrderRequest and ArrayOfLineItems and LineItem types?

If there is no support for complex types in the standard soap libraries,
what would be the simplest way to make a soap request to such a complex
method?

any help would be much appreciated.

regards,

Francois

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
soap complex type seen as nil Raymond O'connor Ruby 2 05-15-2009 02:39 PM
wsdl2java: method parameter a complex type that extends another complex type Robert Mark Bram Java 0 02-04-2007 10:06 AM
[XML Schema] Content type of complex type definition with complex content Stanimir Stamenkov XML 2 10-25-2005 10:16 AM
How do I restrict the type of a text node in a mixed, complex-type element? Chishun Kwong XML 0 03-03-2005 05:09 PM
element of complex type without type="" possible? Ulf Heyder XML 1 10-28-2003 04:30 PM



Advertisments