MessageFactory factory = MessageFactory.newInstance();
SOAPMessage msg = factory.createMessage();
java.net.URL url1 = new java.net.URL("http://www.apache.org/licenses/LICENSE-2.0.html");
java.net.URL url2 = new java.net.URL("http://www.apache.org/licenses/LICENSE-2.0.txt");
AttachmentPart a1 = msg.createAttachmentPart(new javax.activation.DataHandler(url1));
a1.setContentType("text/xml");
msg.addAttachmentPart(a1);
AttachmentPart a2 = msg.createAttachmentPart(new javax.activation.DataHandler(url1));
a2.setContentType("text/xml");
msg.addAttachmentPart(a2);