soap complex type example

F

Francois Paul

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/alturawebservicedev/storewebservice.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="tns:placeOrderRequest"/>
</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_driver
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top