How to generate this SOAP xml request?

178 views
Skip to first unread message

comopasta Gr

unread,
Jan 5, 2010, 7:29:07 AM1/5/10
to rubyonra...@googlegroups.com
Hi,

I trigger the SOAP calls like:

factory = SOAP::RPC::Driver.new('https://blahblah', "urn:services:m33")
factory.add_method('register', 'registrationData')
factory.register(registrationData)

I've been able to call SOAP methods where several unique arguments are
given. But in the code above the object registrationData is supposed to
contain a registrationDataBean which is composed by other sub-items.

Any hints how that object should be created?

The resulting SOAP xml should be like:

<soapenv:Envelope>
<soapenv:Body>
<ns1:register>
<registrationData href="#id0"/>
</ns1:register>

<multiRef id="id0" soapenc:root="0" ...
xsi:type="ns2:RegistrationInfoBean">
<eventEnum href="#id1"/>
<time href="#id2"/>
<UTC href="#id3"/>
<password xsi:type="xsd:string">
password1
</password>
<number href="#id4"/>
<valid href="#id5"/>
</multiRef>

<multiRef id="id5" soapenc:root="0" ... xsi:type="xsd:boolean">
false
</multiRef>

<multiRef id="id3" soapenc:root="0" ...>
12345
</multiRef>

... rest of multiRefs

</soapenv:Body>
</soapenv:Envelope>

I think I could manually generate the required XML but I'd like to see
what is the correct way to avoid that manual work.

Thanks.
--
Posted via http://www.ruby-forum.com/.

comopasta Gr

unread,
Jan 11, 2010, 3:04:29 AM1/11/10
to rubyonra...@googlegroups.com
Anyone?

I'm checking from:
- http://dev.ctor.org/doc/soap4r/
- http://dev.ctor.org/soap4r

I'm sure the info is in front of my eyes but...

Cheers.

comopasta Gr

unread,
Jan 11, 2010, 7:16:11 AM1/11/10
to rubyonra...@googlegroups.com
Hi, I guess this can be ignored. I found out that the best way to do
this is not by generating the soap request manually but leave that work
to wsdl2ruby.

I followed this:
http://www.brendonwilson.com/blog/2006/04/02/ruby-soap4r-wsdl-hell/ and
I'm already making a SOAP call to the method I intended.

Regards

Reply all
Reply to author
Forward
0 new messages