# Send XML Document with SOAP

**URL:** <https://www.ruby-forum.com/t/send-xml-document-with-soap/52355>\
**Category:** Rails\
**Created:** [January 13, 2006, 1:12am UTC](https://www.ruby-forum.com/t/send-xml-document-with-soap/52355 "2006-01-13T01:12:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arlen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7ea924/32.png) [@Arlen](https://www.ruby-forum.com/u/Arlen)\
**Post date:** [January 13, 2006, 1:12am UTC](https://www.ruby-forum.com/t/send-xml-document-with-soap/52355/1 "2006-01-13T01:12:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Arlen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7ea924/32.png) [@Arlen](https://www.ruby-forum.com/u/Arlen)\
**Post date:** [January 13, 2006, 1:14am UTC](https://www.ruby-forum.com/t/send-xml-document-with-soap/52355/2 "2006-01-13T01:14:45Z")

</div>

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/](http://schemas.xmlsoap.org/soap/envelope/)”  
xmlns:xsi=“[http://www.w3.org/2001/XMLSchema-instance](http://www.w3.org/2001/XMLSchema-instance)”  
xmlns:xsd=“[http://www.w3.org/2001/XMLSchema](http://www.w3.org/2001/XMLSchema)”\>
- soap:Body
- \<?xml version="1.0" 

encoding=“utf-16”?\>186860\<![CDATA[

Cal Poly’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.

 

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.

 

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.

 

[Directions and visitor information](http://www.ess.calpoly.edu/_admiss/visit/index.htm).

]]\>  
  
\</soap:Body\>  
\</soap:Envelope\>
