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

Unable to parse response body: (Savon::InvalidResponseError) #29

Open
Ap284 opened this issue Mar 11, 2018 · 1 comment
Open

Unable to parse response body: (Savon::InvalidResponseError) #29

Ap284 opened this issue Mar 11, 2018 · 1 comment

Comments

@Ap284
Copy link

Ap284 commented Mar 11, 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:infind'
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 -- :

@jtzemp
Copy link

jtzemp commented Mar 27, 2018

@AparnaData did you mean to create this Github issue over at https://github.com/savonrb/savon/issues? I'm not seeing anything to do with the lolsoap library in your code.

Also, I'm not sure that you're providing enough data for someone to help you. You'll probably need to give people a look at the raw response you're getting back from the server.

Also noted, I'm not a maintainer of either project and came to `lolsoap/issues looking to see how active the project is.

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