-
Notifications
You must be signed in to change notification settings - Fork 616
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
HTTP Headers in HTTPI Body Doc #682
Comments
Thanks for opening this issue @toobulkeh -- it looks like your response is a multipart response, so you might want to try using Savon Multipart to parse those. Simply adding that to your Gemfile and I've been considering bringing Savon::Multipart directly into core for a while. It seems like a pretty crummy user experience to have to bring in a separate gem whenever you need to parse multipart SOAP responses. Would you let me know if that solves your problem? If not, maybe I can direct you towards the code in Savon that is responsible for parsing the header and body. |
Thanks for the help @tjarratt -- I'm not familiar with multipart responses (or attachments) in SOAP, so that's a great pointer. I'll give it a shot and update this if I need additional help! From the perspective of a newbie to both gems, I would definitely merge them, as it doesn't seem like the functionality needs to be separate (from my perspective). The versioning was a little complex to get setup as well, since the multipart gem is locked to a specific savon version. Hope this helps! |
Unfortunately that didn't solve my problem, as I'm still receiving:
I'll continue to troubleshoot it, thanks! |
Is there a way to force the response to savon-multipart? After researching this more, that's what is happening here... The response is only a normal Savon::Response and doesn't have the multipart functions... even if that's the only gem 'required'... |
pulling from https://github.com/savonrb/savon-multipart/blob/master/spec/savon/soap/response_spec.rb#L9 I created this that forced the response into a multipart class, which worked. globals = {
:multipart => true,
:raise_errors => true,
:convert_response_tags_to => lambda { |tag| tag.snakecase.to_sym}
}
response = Savon::Multipart::Response.new(response.http, globals, {})
response.hash Any ideas why this doesn't happen automatically, or if I'm missing something? Thanks! |
Good question. The multipart detection is probably incomplete. We had a good pull request recently that improved it a bit, but I haven't got around to publishing a new version of the gem yet. It sounds like there's still a bug here, so I'd like to reopen this bug. Would it be possible for you to attach an anonymized response, so I can take a look at the Content-Type header and try to infer why savon-multipart wasn't able to detect the content type correctly? Sent From A Very Small Keyboard
|
let me test it against the current master, then I'll look into submitting a PR if it doesn't work :) |
Can you move the issue to the other github repo? |
Migrated this issue over to Savon-Multipart. |
I'm in the same issue in 2017. I need to get some information of legacy systems using WS, and the response comes with extra content like "\r\n--uuid:51d686cd-1f98-44db-b0f7-84506459ce9d\r\nContent-Type: application/xop+xml;" By the way I'm using the @toobulkeh forced solution to create a Savon::Multipart::Response that gives a clean soap message, but I would be gladfull if Savon or Multipart already did it. |
Any ideas why the response.http.body contains apache header information even though that's parsed out correctly? The following shouldn't be in the body or raw_body:
The text was updated successfully, but these errors were encountered: