# How to generate this SOAP xml request?

**URL:** <https://www.ruby-forum.com/t/how-to-generate-this-soap-xml-request/181093>\
**Category:** Rails\
**Created:** [January 5, 2010, 1:29pm UTC](https://www.ruby-forum.com/t/how-to-generate-this-soap-xml-request/181093 "2010-01-05T13:29:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [January 5, 2010, 1:29pm UTC](https://www.ruby-forum.com/t/how-to-generate-this-soap-xml-request/181093/1 "2010-01-05T13:29:07Z")

</div>

Hi,

I trigger the SOAP calls like:

factory = SOAP::RPC::Driver.new(‘[https://blahblah](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  
  
\</ns1:register\>

```
<multiRef id="id0" soapenc:root="0" ...

```

xsi:type=“ns2:RegistrationInfoBean”\>  
  
  
  
  
password1

```
<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.

---

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [January 11, 2010, 1:16pm UTC](https://www.ruby-forum.com/t/how-to-generate-this-soap-xml-request/181093/2 "2010-01-11T13:16:11Z")

</div>

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/](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

---

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [January 11, 2010, 9:04am UTC](https://www.ruby-forum.com/t/how-to-generate-this-soap-xml-request/181093/3 "2010-01-11T09:04:29Z")

</div>

Anyone?

I’m checking from:

- [http://dev.ctor.org/doc/soap4r/](http://dev.ctor.org/doc/soap4r/)
- [http://dev.ctor.org/soap4r](http://dev.ctor.org/soap4r)

I’m sure the info is in front of my eyes but…

Cheers.
