Forum: Ruby on Rails Send XML Document with SOAP

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

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 = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
result = service.GetAnswer(:question=>'tuition',:id=>'64')
doc = REXML::Document.new 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
Line:
Position:
Last 80 unconsumed characters:
<SOAP::Mapping::Object:0x3761048>>

+++++++++++++++++++++++++++++++++++++++++
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="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <soap:Body>
- <GetAnswerResponse xmlns="http://tempuri.org/">
  <GetAnswerResult><?xml version="1.0"
encoding="utf-16"?><VIRTUALADVISOR><ExpressionID>1868</ExpressionID><CompositeAnswer><CAID>60</CAID><Answer><![CDATA[<font
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
href="http://www.ess.calpoly.edu/_admiss/visit/index.htm"
target="_self">Directions and visitor information</a>.
</font></p></font></font>]]></Answer></CompositeAnswer><Question><![CDATA[location]]></Question></VIRTUALADVISOR></GetAnswerResult>
  </GetAnswerResponse>
  </soap:Body>
  </soap:Envelope>
This topic is locked and can not be replied to.