I am using a SOAP web service to get some information. The SOAP4R
library is supposed to create methods for the elements in a SOAP
response. When I do my SOAP call these methods are not created. The
informations shows up when I do soap_response.inspect but I cannot
access it directly. Is there any way to get access to the raw XML
response so I can parse it myself?
You can use REXML to parse the response directly, which I find easier
than messing with the generated methods. You have to learn a little
Xpath, but it's pretty easy to pick up. I use code like this:
Great advice Mike. I will definitely use it. The problem (which feels
quite silly) is that I cannot get the raw SOAP response from the
SOAP::Mapping::Object instance that is the result of the SOAP call. I
would like to do xml_tree =REXML::Document.new(soap_result.raw_xml)
But what is the raw_xml method?
Great advice Mike. I will definitely use it. The problem (which feels
quite silly) is that I cannot get the raw SOAP response from the
SOAP::Mapping::Object instance that is the result of the SOAP call. I
would like to do xml_tree =REXML::Document.new(soap_result.raw_xml)
But what is the raw_xml method?
Many thanks in advance
Erik
Hi Erik,
Were you able to resolve this issue? I am also having the same issue...
please help...I don't know how to parse my SOAP::Mapping::Object
To get raw XML from SOAP4R set wiredump_file_base attribute of
SOAP::RPC::Driver instance to some string value. It will be used as a
prefix for files to save raw XML request and response in the current
dir.
Or, alternatively, do 'driver.wiredump_dev = STDOUT' and SOAP4R
will push raw XML to the console.