[gmime-devel] Using GMime to build SOAP multipart messages



Hi

Hopefully this turns out to be really simple and I'm staring at the obvious but not connecting the dots. :)

I have two problems:

1:
I want to construct MIME multipart/related messages for use with SOAP as such: http://www.w3.org/TR/SOAP-attachments

Essentially, its a multipart/related where its first part is a SOAP envelope XML string, followed by attachment parts or even other embedded multiparts.

Building this multipart I think I have figured out. The problem I am running into is that I need to separate the top level multipart message's headers from the rest of its contents, as I need to set these headers as HTTP headers. (I am using libcurl to facilitate the HTTP part of the process).

I COULD go and do this by simply calling g_mime_object_to_string() on the GMimeObject and searching for the start of the boundary (from the Content-Type header), and only copying the rest for use as the body. But I was hoping that there would be a neater way to do this directly.


2:
I already have my attachments as base64 encoded strings when I get to this point in the process. I would like to add them as parts to the multipart directly (with Content-Transfer-Encoding set to base64), without needing to decode and re-encode the data unnecessarily.

Regards
Johan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]