Forum: Ruby on Rails Send XML Document with SOAP

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Arlen (Guest)
on 2006-01-13 02:12

yes it's another ruby-nuby question but i cant find the right docs so I
hope either someone has an answer or can provide links to what i havent
been able to find.

I am trying to call a wsdl web service running on .net server with a
ruby client. I can make the request and with a wiredump I see the SOAP
request and responce XML files, the files are correct but I am not sure
why I can not access the results.


require "rexml/document"
service =
result = service.GetAnswer(:question=>'tuition',:id=>'64')
doc = result
render_text doc.to_s

this is what I get

"SOAP::Mapping::Object is not a valid input stream.  It must be
either a String, IO, StringIO or Source."

why is the result not an XML string? it appears as if result is empty
eveI have tried converting the result to a sting but it give me another
error suggesting that the result variable is empty

#<REXML::ParseException: malformed XML: missing tag start
Last 80 unconsumed characters:

any assistance would be greatly appreciated.

thanks, Arlen Thurber
Arlen (Guest)
on 2006-01-13 02:14
here is the SOAP responce I am recieving, is there a problem with the
way it is trying to send an XML document with in the SOAP responce? It
works fine in JAVA but i am wondering if there is an issue with the way
RUBY parses the SOAP responce.

  <?xml version="1.0" encoding="utf-8" ?>
- <soap:Envelope xmlns:soap=""
- <soap:Body>
- <GetAnswerResponse xmlns="">
  <GetAnswerResult><?xml version="1.0"
face="Arial" size="2"><font face="Arial" color="#ff00ff"> <p><font
color="#000000">Cal Poly&#8217;s 6,000+ acre campus is located in San
Luis Obispo, California, midway between San Francisco and Los A.,
making the university one of the largest campuses in the nation in terms
of physical size. </font></p> <p><font color="#000000">The surrounding
area boasts mild temperatures year round and offers many types of
outdoor recreation including the Pacific beaches, local mountain areas
and nearby lakes.</font></p> <p><font color="#000000">Some of these
areas are: Pismo Beach, Avila Beach, Morro Bay, Lake Lopez, Lake
Nacimiento, Lake San Antonio, Hearst Castle, Bishop's Peak and Madonna
Mountain.</font></p> <p><font color="#000000"><a
target="_self">Directions and visitor information</a>.
This topic is locked and can not be replied to.