soap complex type example

Discussion in 'Ruby' started by Francois Paul, Aug 14, 2006.

  1. 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
     
    Francois Paul, Aug 14, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. news.amnet.net.au
    Replies:
    1
    Views:
    589
    =?UTF-8?b?TMSByrtpZSBUZWNoaWU=?=
    Apr 13, 2004
  2. Ulf Heyder
    Replies:
    1
    Views:
    506
    Patrick TJ McPhee
    Oct 28, 2003
  3. Chishun Kwong
    Replies:
    0
    Views:
    430
    Chishun Kwong
    Mar 3, 2005
  4. Stanimir Stamenkov
    Replies:
    2
    Views:
    767
    Stanimir Stamenkov
    Oct 25, 2005
  5. Robert Mark Bram
    Replies:
    0
    Views:
    700
    Robert Mark Bram
    Feb 4, 2007
Loading...

Share This Page