# Parsing XML and then sending via SOAP

**URL:** <https://www.ruby-forum.com/t/parsing-xml-and-then-sending-via-soap/83372>\
**Category:** Ruby\
**Created:** [January 25, 2007, 5:08pm UTC](https://www.ruby-forum.com/t/parsing-xml-and-then-sending-via-soap/83372 "2007-01-25T17:08:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shinji](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c6cbf5/32.png) [@shinji](https://www.ruby-forum.com/u/shinji)\
**Post date:** [January 25, 2007, 5:08pm UTC](https://www.ruby-forum.com/t/parsing-xml-and-then-sending-via-soap/83372/1 "2007-01-25T17:08:52Z")

</div>

I’m looking to write a small test stub that will read in some XML from a  
document, and then send it wrapped up in a SOAP envelope. I’ve found the  
[XML.com](http://XML.com) documentation useful

[http://www.xml.com/pub/a/2005/11/09/rexml-processing-xml-in-ruby.html](http://www.xml.com/pub/a/2005/11/09/rexml-processing-xml-in-ruby.html)

but haven’t really worked out whether I can do the following:

Read the document in as a File  
create an REXML document file handle  
send that file handle wrapped in a soap envelope

?

If so, has anyone got some good documentation on constructing and  
sending out XML via SOAP? I’ve played about before with the SOAP calls  
to Google/Yahoo/Amazon etc. but not tried wrapping up ML and sending it  
before…

Even some short examples would be much appreciated.
