Ejemplo n.º 1
0
 /**
  * Updates this <CODE>SOAPMessage</CODE> object with all the changes that have been made to it.
  * This method is called automatically when a message is sent or written to by the methods <CODE>
  * ProviderConnection.send</CODE>, <CODE>
  *   SOAPConnection.call</CODE>, or <CODE>
  *   SOAPMessage.writeTo</CODE>. However, if changes are made to a message that was received or to
  * one that has already been sent, the method <CODE>saveChanges</CODE> needs to be called
  * explicitly in order to save the changes. The method <CODE>saveChanges</CODE> also generates any
  * changes that can be read back (for example, a MessageId in profiles that support a message id).
  * All MIME headers in a message that is created for sending purposes are guaranteed to have valid
  * values only after <CODE>saveChanges</CODE> has been called.
  *
  * <p>In addition, this method marks the point at which the data from all constituent <CODE>
  * AttachmentPart</CODE> objects are pulled into the message.
  *
  * @throws SOAPException if there was a problem saving changes to this message.
  */
 public void saveChanges() throws SOAPException {
   headers.removeHeader("Content-Length");
   if (mAttachments != null && 0 < mAttachments.getAttachmentCount()) {
     try {
       headers.setHeader("Content-Type", mAttachments.getContentType());
     } catch (AxisFault af) {
       log.error(Messages.getMessage("exception00"), af);
     }
   }
   saveRequired = false;
   try {
     /* Fix for Bug 16418 - Start from scratch */
     mSOAPPart.saveChanges();
   } catch (AxisFault axisFault) {
     log.error(Messages.getMessage("exception00"), axisFault);
   }
 }