Previous section   Next section
SOAPPart javax.xml.soap

SAAJ 1.1; JWSDP 1.0, J2EE 1.4
public abstract class SOAPPart {
// Public Constructors
    public SOAPPart(  ); 
// Property Accessor Methods (by property name)
    public abstract Iterator getAllMimeHeaders(  ); 
    public abstract javax.xml.transform.Source getContent(  ) 
       throws SOAPException; 
    public abstract void setContent(javax.xml.transform.Source source) 
       throws SOAPException; 
    public String getContentId(  ); 
    public void setContentId( String contentId); 
    public String getContentLocation(  ); 
    public void setContentLocation(String contentLocation); 
    public abstract SOAPEnvelope getEnvelope(  ) throws SOAPException; 
// Public Instance Methods
    public abstract void addMimeHeader(String name, String value); 
    public abstract Iterator getMatchingMimeHeaders(String[ ] names); 
    public abstract String[ ] getMimeHeader(String name); 
    public abstract Iterator getNonMatchingMimeHeaders(String[ ] names); 
    public abstract void removeAllMimeHeaders(  ); 
    public abstract void removeMimeHeader( String header); 
    public abstract void setMimeHeader(String name, String value); 
}

SOAPPart is a container that wraps the envelope of a SOAP message. To get a reference to the SOAPPart, use the getSOAPPart( ) method of the containing SOAPMessage. Aside from getEnvelope( ), all of the methods of the SOAPPart interface are concerned with manipulating its associated MIME headers, which are used only if the SOAP message has one or more MIME attachments. Refer to the reference section for AttachmentPart, earlier in this chapter for a description of these methods.

Note that, unlike most interfaces that represent parts of a SOAP message, SOAPPart is not a subinterface of SOAPElement, and therefore does not have methods that allow content to be added to or removed from it. However, you can change the entire content of the SOAPPart by calling the setContent( ) method, which requires an argument of type javax.xml.transform.Source and supplies the XML representation of a complete SOAP message starting from the Envelope tag (but excluding attachments). The message content can be supplied in the form of a DOM tree, a SAX parser stream, or an input stream reading from a file or some other source.

Returned By

SOAPMessage.getSOAPPart( )


  Previous section   Next section