Handling Savon Response with Nokogiri's Gem

212 views
Skip to first unread message

t3en4

unread,
Jul 4, 2011, 11:16:02 AM7/4/11
to sav...@googlegroups.com
Hi!

I'm trying to navigate through the SOAP Response that I get from Savon using Nokogiri's Gem.

However, I think I'm missing something since:

doc = Nokogiri::XML(response.to_xml)
#response is a Savon::SOAP::Response object

doesn't work because I can't find any nodes when I execute:

doc.at('tagx').text (I always get nil)

I think the .to_xml is not parsing the Savon Response correctly. Am I wrong with that?

Thx!

rubiii

unread,
Jul 6, 2011, 12:30:29 PM7/6/11
to Savon
that should work just fine. what does response.to_xml return?
if your request was successful, it should return the raw soap response.

t3en4

unread,
Jul 6, 2011, 5:34:34 PM7/6/11
to sav...@googlegroups.com
Solve it... Thanks anyway

rubiii

unread,
Feb 7, 2013, 12:07:58 PM2/7/13
to sav...@googlegroups.com, aprilia...@gmail.com
response#to_xml does not parse the response. it simply returns the http request body.
you should inspect it to make sure it's ok.

cheers,
daniel

Reply all
Reply to author
Forward
0 new messages