Example usage for javax.xml.soap MimeHeaders MimeHeaders

List of usage examples for javax.xml.soap MimeHeaders MimeHeaders

Introduction

In this page you can find the example usage for javax.xml.soap MimeHeaders MimeHeaders.

Prototype

public MimeHeaders() 

Source Link

Document

Constructs a default MimeHeaders object initialized with an empty Vector object.

Usage

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();
}