List of usage examples for javax.xml.soap MimeHeaders MimeHeaders
public MimeHeaders()
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);//from ww w . jav a2 s . c om assertTrue(envelope != null); return msg.countAttachments(); }