1 6 7 28 package javax.xml.soap; 29 import java.io.OutputStream ; 30 import java.io.IOException ; 31 32 import java.util.Iterator ; 33 34 import javax.activation.DataHandler ; 35 36 106 public abstract class SOAPMessage { 107 115 public static final String CHARACTER_SET_ENCODING = 116 "javax.xml.soap.character-set-encoding"; 117 118 126 public static final String WRITE_XML_DECLARATION = 127 "javax.xml.soap.write-xml-declaration"; 128 129 137 public abstract void setContentDescription(String description); 138 139 147 public abstract String getContentDescription(); 148 149 158 public abstract SOAPPart getSOAPPart(); 159 160 170 public SOAPBody getSOAPBody() throws SOAPException { 171 throw new UnsupportedOperationException ("getSOAPBody must be overridden by all subclasses of SOAPMessage"); 172 } 173 174 185 public SOAPHeader getSOAPHeader() throws SOAPException { 186 throw new UnsupportedOperationException ("getSOAPHeader must be overridden by all subclasses of SOAPMessage"); 187 } 188 189 195 public abstract void removeAllAttachments(); 196 197 204 public abstract int countAttachments(); 205 206 212 public abstract Iterator getAttachments(); 213 214 225 public abstract Iterator getAttachments(MimeHeaders headers); 226 227 237 public abstract void removeAttachments(MimeHeaders headers); 238 239 240 265 public abstract AttachmentPart getAttachment(SOAPElement element) throws SOAPException ; 266 267 268 278 public abstract void addAttachmentPart(AttachmentPart AttachmentPart); 279 280 289 public abstract AttachmentPart createAttachmentPart(); 290 291 307 public AttachmentPart createAttachmentPart(DataHandler dataHandler) { 308 AttachmentPart attachment = createAttachmentPart(); 309 attachment.setDataHandler(dataHandler); 310 return attachment; 311 } 312 313 320 public abstract MimeHeaders getMimeHeaders(); 321 322 344 public AttachmentPart createAttachmentPart( 345 Object content, 346 String contentType) { 347 AttachmentPart attachment = createAttachmentPart(); 348 attachment.setContent(content, contentType); 349 return attachment; 350 } 351 352 372 public abstract void saveChanges() throws SOAPException ; 373 374 381 public abstract boolean saveRequired(); 382 383 403 public abstract void writeTo(OutputStream out) 404 throws SOAPException , IOException ; 405 406 439 public void setProperty(String property, Object value) 440 throws SOAPException { 441 throw new UnsupportedOperationException ("setProperty must be overridden by all subclasses of SOAPMessage"); 442 } 443 444 455 public Object getProperty(String property) throws SOAPException { 456 throw new UnsupportedOperationException ("getProperty must be overridden by all subclasses of SOAPMessage"); 457 } 458 } 459 | Popular Tags |