-
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
Add support for multipart MIME in Savon2 #424
Comments
no. that really has to be pushed by people who need multipart support. |
I also just discovered the multipart response support in Savon 1.0 and was surprised it wasn't present in 2.0; it sounds like you're open to pull requests, do you have any thoughts re: how that might work? Looking at the old implementation, as far as I can tell, the code strips apart the boundaries and just concatenates the body together. In my case, I expect to get back some XML followed by several multi-part messages that are base64 encoded images. I was thinking of exposing those as an #attachments method on the response. |
i think you're right in that multipart support has been ported to v2 yet. so, since almost noone used this feature in v1, i don't think it should ship with savon. what i would like to see instead, as far as i know, your observation about how savon-multipart currently works is right. @ebeigarts maintains the savon-multipart gem (thanks!) , so let's see what he thinks. |
Many thanks for responding so quickly and pointing out savon-multipart -- I wasn't aware of that gem. That's an interesting approach that should work; I can definitely see the appeal of not cluttering the savon gem with knowledge of how to decode multipart http responses since very few people will actually use it. My current thinking is that maybe savon-multipart could just override Savon::Operation#call, taking a local argument that indicates whether the response is expected to be multipart or not -- this would change whether we return a Savon::Response or some Savon::MultipartResponse. Ideally it wouldn't need to patch any methods, but with the current design of Savon::Client, Operation and Response, I can't see how else you would inject a different response that can decode multipart messages. |
i would really not go with overwriting savon. that was a bad idea back then and it still is. i think we can come up with a better interface to properly support this. what i understand is that you would i would have to look at the code to know if that can also cover the current use cases for savon-multipart |
Absolutely, I want to preserve everything that's already in savon-multipart and make it work with Savon 2.0. I'll take a closer look at how the Savon::Response is created, maybe there's a simpler interface that doesn't require overwriting any methods at all. Or perhaps @ebeigarts will have some thoughts. |
what about a new then savon-multipart would somehow need to tell savon to use a different class for the response. |
👍 It's a big change from the previous implementation, but I do like how it would indicate multipart support from savon itself. I wasn't even aware of the savon-multipart gem today after having poked around in the code and read a few old issues. I'll fork this in a bit, write some tests and see if I can get a pull request together. |
great! let me know how it's going. |
I'm still using savon 1, haven't looked at savon 2 yet. But this sounds great :) |
@freakyfelt if you're interesting in using savon with multipart HTTP responses, could you try using the latest savon with my branch of savon-multipart? I'm already using it in production, but it would be great to get some more feedback from other people using savon2. This gist might be helpful to get everything setup for your tests: https://gist.github.com/tjarratt/5530566 |
Sure, I'll take a look later this week. Thanks for the help Bruce Felt On May 6, 2013, at 11:12 PM, Tim Jarratt notifications@github.com wrote:
|
+1 for multipart support. happy to help in testing. |
👍 👍 |
Sorry guys, could you tell me how to attach a file on client message, and then receive it on the server side with savon-multipart. Thanks!! |
this will be released with version 2.3.0. see #481. |
@tjarratt i'm going to release v2.3.0 later today and then i think we should get the savon-multipart |
Sounds great! I actually moved away from using savon-multipart for some projects at work, but I am still using it for a few smaller things. Been looking forward to getting it released for a while 👍 |
In working with a SOAP response I discovered that it contains a multipart MIME response in the body that causes Savon to barf. I see that this was fixed with savon-multipart, however that was for Savon 1.0. Is there anything in the road map to add multipart support to Savon 2?
The text was updated successfully, but these errors were encountered: