List of usage examples for javax.xml.soap MimeHeaders setHeader
public void setHeader(String name, String value)
From source file:test.saaj.TestAttachmentSerialization.java
public int loadMsgWithAttachments(InputStream is) throws Exception { MimeHeaders headers = new MimeHeaders(); headers.setHeader("Content-Type", MIME_MULTIPART_RELATED); MessageFactory mf = MessageFactory.newInstance(); SOAPMessage msg = mf.createMessage(headers, is); SOAPPart sp = msg.getSOAPPart(); SOAPEnvelope envelope = sp.getEnvelope(); assertTrue(sp != null);/* ww w.jav a2 s. c o m*/ assertTrue(envelope != null); return msg.countAttachments(); }