Skip to content
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

response does not respect :convert_response_tags_to and :strip_namespaces options #474

Closed
rubiii opened this issue Jun 30, 2013 · 4 comments
Assignees

Comments

@rubiii
Copy link
Contributor

rubiii commented Jun 30, 2013

Savon::Response#header and Savon::Response#body currently don't respect the global :convert_response_tags_to option and raise a Savon::InvalidResponseError if the option
is set to return anything other than a snake_case symbol.

lib/savon/response.rb#L33

i'm going to change all cases of hardcoded snakecase symbols (e.g. :envelope: and :header)
to use Nori#find which respects the :convert_response_tags_to option.

@ghost ghost assigned rubiii Jun 30, 2013
@rubiii
Copy link
Contributor Author

rubiii commented Jun 30, 2013

just noticed, that both methods also don't respect the global :strip_namespaces option.
so if you're not stripping the namespaces from response hash keys, both methods will raise an error.
i'm going to fix this as well.

rubiii added a commit that referenced this issue Jun 30, 2013
both methods now respect the global :convert_response_tags_to and
:strip_namespaces options and return the expected result instead of
raising a Savon::InvalidResponseError.
This was referenced Jul 26, 2013
@stale
Copy link

stale bot commented Feb 20, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Feb 20, 2018
@stale
Copy link

stale bot commented Feb 27, 2018

This issue is now closed due to inactivity. If you believe this needs further action, please re-open to discuss.

@stale stale bot closed this as completed Feb 27, 2018
@Ap284
Copy link

Ap284 commented Mar 10, 2018

Hello,
I am implementing WSSE security using savon. I got status code 200 and response is blank but raises error `raise_invalid_response_error!': Unable to parse response body: (Savon::InvalidResponseError)
Here is my code
require 'savon'

@client = Savon.client(
:endpoint => 'https://example.com',
:wsdl => 'https://example/UserService.wsdl',
:log => true,
:wsse_auth => ['Username', 'Password'],
:pretty_print_xml => true,
:convert_request_keys_to => :camelcase,
:env_namespace => :s,
:namespace_identifier => nil
)

message = {
nabp: '1111111',
ndc: '1234567',
qty: 30,
days: 30
}

response = @client.call(:example,
:message => message,
:soap_header => { "Action" => ""})

response.to_hash[:example_response][:example_result]

Output
/home/admin12/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/savon-2.12.0/lib/savon/response.rb:90:in raise_invalid_response_error!': Unable to parse response body: (Savon::InvalidResponseError) "" from /home/admin12/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/savon-2.12.0/lib/savon/response.rb:72:in find'
from /home/admin12/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/savon-2.12.0/lib/savon/response.rb:37:in body' from /home/admin12/RubymineProjects/Wsse/worker.rb:34:in <top (required)>'
from -e:1:in load' from -e:1:in

'
I, [2018-03-10T12:23:49.932977 #5277] INFO -- : SOAP response (status 200)
D, [2018-03-10T12:23:49.933051 #5277] DEBUG -- :

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants