Back Forum Reply New

How to set content type and content id on mime message?

Hi,

I am using spring-ws.1.5.7 with axiom-api to send a soap message with pdf attachment. My client requires me to send a specific content id for mime message and the attachment. The axiom soap message allows me to set content id and content type to the attachment. But I didn't see any way to set these details to the mime message. Is there any way to set the content id and content type to the mime message? Thanks in advance.

Here is a sniplet of the expected soap response:

from/1.1 200 OK
Date: Tue, 08 Feb 2011 14:35:45 GMT
Server: Apache
Set-Cookie: WebSessionID=10.128.179.195.1297175745023573; path=/
Transfer-Encoding: chunked
Content-Type: multipart/related;boundary=quot;---AcceptanceRSquot;;type=quot;text/xmlquot;
Content-Language: en-US

Content-Type: multipart/related; boundary=---AcceptanceRS; type=quot;text/xmlquot;

-----AcceptanceRS
Content-Type: text/xml; charset=utf-8
Content-Transfer-Encoding: binary
Content-Id: AcceptanceRS[0]/Attachment[0]/URI[0]

lt;soapenv:Envelope xmlns:soapenv=quot;soap/envelope/quot; xmlns:all=quot;quot;gt;lt;soapenv:Header/gt;lt;soapenv:Bodygt;lt;all:AcceptanceRSgt;lt;Testgt;Hellolt;/Testgt;lt;/all:AcceptanceRSgt;lt;/soapenv:Bodygt;lt;/soapenv:Envelopegt;

-----AcceptanceRS

Content-Type: application/pdf; name=quotolicy_Document.pdfquot;
Content-Disposition: attachment; filename=Policy_Document.pdf
Content-Transfer-Encoding: base64
Content-Id: AcceptanceRS[1]/Attachment[1]/URI[1]

JVBERi0xLjIKJdDT1MwKMSAwIG9iago8PAovVHlwZSAvQ2F0YW  xvZwovUGFnZXMgMyAwIFIKL0Rlc3RzIDUgMCBSCi9QYWdlTW

-----AcceptanceRS--

Best,
Jaise

Hi Guys, could anyone of you kindly give me a reply? I am stuck on this for more than a week.

Hi All..

From my experience over the past couple of weeks with spring web service, I understood that there is little control over the mime message using spring apis. Saaj api offers no methods to set custom mime boundary, attachment content id and root content id. If you use axiom api instead of saaj api, you could set the content id for attachment. But then also the rest of the values are auto generated by axiom api.
I don't know if spring supports any custom interceptors/handlers to override the default mime message properties. This could be done in axis2 by extending the fromtransportsender with your own handler class as I did and configuring it in axis2.xml file. Hope this would help.

Best,
Jaise
¥
Back Forum Reply New