Last active
December 24, 2015 17:39
-
-
Save thiamteck/6837132 to your computer and use it in GitHub Desktop.
Set content type, encoding of attachment when using Axis2 to send SOAP request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// import these: | |
// | |
// import org.apache.axiom.attachments.Attachments; | |
// import org.apache.axiom.attachments.ConfigurableDataHandler; | |
// import javax.activation.FileDataSource | |
Attachments attachments = new Attachments(); | |
ConfigurableDataHandler dh = new ConfigurableDataHandler(new FileDataSource("testing.gif")); // file path | |
dh.setContentType("image/gif"); | |
dh.setTransferEncoding("base64"); | |
attachments.addDataHandler("testing.gif", dh); // just file name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment