axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Kok <ste...@opensolutions.co.za>
Subject SWA encoding control
Date Tue, 02 Jan 2007 15:05:03 GMT
Hi All

Using SWA to send an attachment to a server. SWA forms the message as
multipart/related. Which is all fine. But then it sends the attachment
in binary format. 

The server I am sending to will not accept any binary encoded data. So I
have to find a way to get SWA to send it across as Base64.

Below is a code snippet I of my code:

FileDataSource fileDataSource = new FileDataSource(bridge.jpg");
DataHandler dh = new DataHandler(fileDataSource);

MessageContext msgCtx = new MessageContext();
msgCtx.setEnvelope(env);

String contentType = msgCtx.addAttachment(dh);
content.addAttribute("href", contentType, nms);


-- 
Stefan Kok <stefan@opensolutions.co.za>


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message