Savon and Ruby to call a webservice

166 views Asked by At

I have a SOAP request

<Register>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" >
<soap:Header/><soap:Body>
<Register>
<identifiers>?</identifiers>
<userId></userId>
<password pwct="?">?</password>
<locale>?</locale>
</Register>

Fully Formed Request that works is 

        <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
        <soap:Header/>
        <soap:Body>
         <Register>
          <identifiers>
            <DIdentifiers>
         <Section name="IDENTIFIERS">
    <Property name="Type" value="Support" />        
    <Property name="Version" value="3.80 Jan 03 2013" />
    <Property name="Timestamp" value="2015/06/08 11:57:48 GMT" />
    <Property name="SerialNumber" value="00004" />
    <Property name="Hostname" value="gmail.com" />
    <Property name="ProductNumber" value="C00004" />
    </Section><Section name="INTERFACE_IDENTIFIERS">
    <Property name="InterfaceAddress" value="45.34.54.6"/>
    <Property name="InterfaceMacAddress" value="00579FGHslkf"/>
    </Section>
    </DIdentifiers>
    </identifiers>
       <userId> <userId>
       <password pwct="TRUE">shirl123</reg:password>
        <locale>en_US</locale>
     <Register>
    </soap:Body>
   </soap:Envelope>

I have added 

    WSDL client = Savon::client(wsdl: " ")

And calling method  

    client.call(:Register, message: { })

How can I send the above parameters in Ruby? Could not figure out the correct way to pass parameters

I'm passing 
DeviceIdentifiers: {
    :Section=> {
     { :Property    => nil,
       :attributes! => { :Property => { "name" => Type, "value" =>Support} }
    }
}

But this doesnot work..

I referred to this http://savonrb.com/version1/executing-soap-requests.html

0

There are 0 answers