jwagenleitner / groovy-wslite

Lightweight SOAP and REST webservice clients for Groovy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MTOM support

tobia opened this issue · comments

commented

Is it possible to add MIME parts (attachments) to the HTTP requests made with SOAPClient? This is needed to talk to endpoints that require MTOM

Basically, MTOM specifies that large blobs can be omitted from the XML, replacing them with a string like cid:someContentId (for example, <zipFile>cid:someContentId</zipFile> instead of a huge base64 inside that tag.) The blobs are then attached to the HTTP request, outside of the XML, using the same MIME Content-ID as the "cid" value referenced in the XML.

Considering the nature of WSLite, all of the XML manipulation (replacing the blobs with cid:... strings) should probably be done by hand, inside the builder closure. But we would need SOAPClient to provide a method to set the outer Content-Type and a few other misc headers, as detailed here, and another method to add binary attachments to the request, each with custom a Content-Type and Content-ID.