-
Notifications
You must be signed in to change notification settings - Fork 615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#xpath and #xml methods on the Response class #210
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Write integration test (currently pending) for multiple namespaces.
We don't pay attention to the type of a field yet.
Conflicts are resolved but the parser does not work with types yet.
Down to two failures in parser_spec.
All non-pending tests now passing.
…t) someday write.
Add support for setting a global soap header
instead of yielding different numbers of objects to any block given to Savon::Client.new and Savon::Client#request, Savon now evaluates the block or yields the Savon::Client instance if the block expects a single argument.
Multiple namespace
namespace name.
The bug only showed up in Ruby 1.9 because we had been accidentally calling [:Save, {}].to_s and hoping to get "Save" (which happens to work in 1.8).
to believe the namespaces implied by the WSDL, rather than one which the Savon caller explicitly specified.
1.9 fixes
please take a look at Nori's CHANGELOG for detailed information
… through Gyoku first. Fixes #194.
thanks! merged into master. adding |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I find that I'm frequently doing Nokogiri::XML(response.body) and working with that. Since you're already requiring Nokogiri, it seems like it'd be helpful to apply some sugar here: response.xml is the same as that, and memoizes the document as well. response.xpath(path) is response.xml.xpath(path, namespaces) where +namespaces+ is a hash of all the namespaces used in the document. (I'm having to deal with a SOAP service where every response has something like 10-15 namespaces.)
These are pretty low-level. I'll probably also be adding #xpath_value to automatically do .first.inner_text, #xpath_values to do .map{|ele| ele.inner_text}, etc.