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

Improve detection of multipart responses #18

Open
tjarratt opened this issue May 20, 2015 · 3 comments
Open

Improve detection of multipart responses #18

tjarratt opened this issue May 20, 2015 · 3 comments

Comments

@tjarratt
Copy link
Contributor

Cloned from Savon issue 682. savonrb/savon#682

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!

A good workaround might be to consider an option that just allows the user to force the response to be parsed as multipart, or possibly improving the regex to allow for more varied types of multipart headers.

@tjarratt
Copy link
Contributor Author

Hey @toobulkeh is it possible this was fixed by the most recent release of Savon-Multipart? A lovely contributor recently made the check for the multipart content-type header case insensitive, and I was wondering if that might fix your issue.

@toobulkeh
Copy link

let me check it out, thanks for the follow up!

@alexmonteiro
Copy link

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.

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

No branches or pull requests

3 participants