Methods Summary |
---|
public void | addMimeHeader(java.lang.String header, java.lang.String value)Add the specified MIME header, as per JAXM.
mimeHeaders.addHeader(header, value);
|
public org.w3c.dom.Node | adoptNode(org.w3c.dom.Node node)
throw new UnsupportedOperationException("Not yet implemented.77");
|
public org.w3c.dom.Node | appendChild(org.w3c.dom.Node newChild)
return document.appendChild(newChild);
|
public org.w3c.dom.Node | cloneNode(boolean deep)
return document.cloneNode(deep);
|
public org.w3c.dom.Attr | createAttribute(java.lang.String name)
return document.createAttribute(name);
|
public org.w3c.dom.Attr | createAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName)
return document.createAttributeNS(namespaceURI, qualifiedName);
|
public org.w3c.dom.CDATASection | createCDATASection(java.lang.String data)
return document.createCDATASection(data);
|
public org.w3c.dom.Comment | createComment(java.lang.String data)
return document.createComment(data);
|
public org.w3c.dom.DocumentFragment | createDocumentFragment()
return document.createDocumentFragment();
|
public org.w3c.dom.Element | createElement(java.lang.String tagName)
return document.createElement(tagName);
|
public org.w3c.dom.Element | createElementNS(java.lang.String namespaceURI, java.lang.String qualifiedName)
return document.createElementNS(namespaceURI, qualifiedName);
|
public org.w3c.dom.EntityReference | createEntityReference(java.lang.String name)
return document.createEntityReference(name);
|
public org.w3c.dom.ProcessingInstruction | createProcessingInstruction(java.lang.String target, java.lang.String data)
return document.createProcessingInstruction(target,data);
|
public org.w3c.dom.Text | createTextNode(java.lang.String data)
return document.createTextNode(data);
|
public java.util.Iterator | getAllMimeHeaders()Retrieves all the headers for this SOAPPart
object as an iterator over the MimeHeader
objects.
return mimeHeaders.getAllHeaders();
|
public byte[] | getAsBytes()Get the contents of this Part (not the headers!), as a byte
array. This will force buffering of the message.
log.debug("Enter: SOAPPart::getAsBytes");
if ( currentForm == FORM_OPTIMIZED ) {
log.debug("Exit: SOAPPart::getAsBytes");
try {
return ((ByteArray) currentMessage).toByteArray();
} catch (IOException e) {
throw AxisFault.makeFault(e);
}
}
if ( currentForm == FORM_BYTES ) {
log.debug("Exit: SOAPPart::getAsBytes");
return (byte[])currentMessage;
}
if ( currentForm == FORM_BODYINSTREAM ) {
try {
getAsSOAPEnvelope();
} catch (Exception e) {
log.fatal(Messages.getMessage("makeEnvFail00"), e);
log.debug("Exit: SOAPPart::getAsBytes");
return null;
}
}
if ( currentForm == FORM_INPUTSTREAM ) {
// Assumes we don't need a content length
try {
InputStream inp = null;
byte[] buf = null;
try{
inp = (InputStream) currentMessage ;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
buf = new byte[4096];
int len ;
while ( (len = inp.read(buf,0,4096)) != -1 )
baos.write( buf, 0, len );
buf = baos.toByteArray();
}finally{
if(inp != null &&
currentMessage instanceof org.apache.axis.transport.http.SocketInputStream )
inp.close();
}
setCurrentForm( buf, FORM_BYTES );
log.debug("Exit: SOAPPart::getAsBytes");
return (byte[])currentMessage;
}
catch( Exception e ) {
log.error(Messages.getMessage("exception00"), e);
}
log.debug("Exit: SOAPPart::getAsBytes");
return null;
}
if ( currentForm == FORM_SOAPENVELOPE ||
currentForm == FORM_FAULT ){
currentEncoding = XMLUtils.getEncoding(msgObject, null);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
BufferedOutputStream os = new BufferedOutputStream(baos);
try {
this.writeTo(os);
os.flush();
} catch (Exception e) {
throw AxisFault.makeFault(e);
}
setCurrentForm(baos.toByteArray(), FORM_BYTES);
if (log.isDebugEnabled()) {
log.debug("Exit: SOAPPart::getAsBytes(): " + currentMessage);
}
return (byte[]) currentMessage;
}
if ( currentForm == FORM_STRING ) {
// If the current message was already converted from
// a byte[] to String, return the byte[] representation
// (this is done to avoid unnecessary conversions)
if (currentMessage == currentMessageAsString &&
currentMessageAsBytes != null) {
if (log.isDebugEnabled()) {
log.debug("Exit: SOAPPart::getAsBytes()");
}
return currentMessageAsBytes;
}
// Save this message in case it is requested later in getAsString
currentMessageAsString = (String) currentMessage;
try{
currentEncoding = XMLUtils.getEncoding(msgObject, null);
setCurrentForm( ((String)currentMessage).getBytes(currentEncoding),
FORM_BYTES );
}catch(UnsupportedEncodingException ue){
setCurrentForm( ((String)currentMessage).getBytes(),
FORM_BYTES );
}
currentMessageAsBytes = (byte[]) currentMessage;
log.debug("Exit: SOAPPart::getAsBytes");
return (byte[])currentMessage;
}
log.error(Messages.getMessage("cantConvert00", ""+currentForm));
log.debug("Exit: SOAPPart::getAsBytes");
return null;
|
public org.apache.axis.message.SOAPEnvelope | getAsSOAPEnvelope()Get the contents of this Part (not the MIME headers!), as a
SOAPEnvelope. This will force a complete parse of the
message.
if (log.isDebugEnabled()) {
log.debug("Enter: SOAPPart::getAsSOAPEnvelope()");
log.debug(Messages.getMessage("currForm", formNames[currentForm]));
}
if ( currentForm == FORM_SOAPENVELOPE )
return (SOAPEnvelope)currentMessage;
if (currentForm == FORM_BODYINSTREAM) {
InputStreamBody bodyEl =
new InputStreamBody((InputStream)currentMessage);
SOAPEnvelope env = new SOAPEnvelope();
env.setOwnerDocument(this);
env.addBodyElement(bodyEl);
setCurrentForm(env, FORM_SOAPENVELOPE);
return env;
}
InputSource is;
if ( currentForm == FORM_INPUTSTREAM ) {
is = new InputSource( (InputStream) currentMessage );
String encoding = XMLUtils.getEncoding(msgObject, null, null);
if (encoding != null) {
currentEncoding = encoding;
is.setEncoding(currentEncoding);
}
} else {
is = new InputSource(new StringReader(getAsString()));
}
DeserializationContext dser = new DeserializationContext(is,
getMessage().getMessageContext(),
getMessage().getMessageType());
dser.getEnvelope().setOwnerDocument(this);
// This may throw a SAXException
try {
dser.parse();
} catch (SAXException e) {
Exception real = e.getException();
if (real == null)
real = e;
throw AxisFault.makeFault(real);
}
SOAPEnvelope nse= dser.getEnvelope();
if(currentMessageAsEnvelope != null){
//Need to synchronize back processed header info.
Vector newHeaders= nse.getHeaders();
Vector oldHeaders= currentMessageAsEnvelope.getHeaders();
if( null != newHeaders && null != oldHeaders){
Iterator ohi= oldHeaders.iterator();
Iterator nhi= newHeaders.iterator();
while( ohi.hasNext() && nhi.hasNext()){
SOAPHeaderElement nhe= (SOAPHeaderElement)nhi.next();
SOAPHeaderElement ohe= (SOAPHeaderElement)ohi.next();
if(ohe.isProcessed()) nhe.setProcessed(true);
}
}
}
setCurrentForm(nse, FORM_SOAPENVELOPE);
log.debug("Exit: SOAPPart::getAsSOAPEnvelope");
SOAPEnvelope env = (SOAPEnvelope)currentMessage;
env.setOwnerDocument(this);
return env;
|
public java.lang.String | getAsString()Get the contents of this Part (not the headers!), as a String.
This will force buffering of the message.
log.debug("Enter: SOAPPart::getAsString");
if ( currentForm == FORM_STRING ) {
if (log.isDebugEnabled()) {
log.debug("Exit: SOAPPart::getAsString(): " + currentMessage);
}
return (String)currentMessage;
}
if ( currentForm == FORM_INPUTSTREAM ||
currentForm == FORM_BODYINSTREAM ) {
getAsBytes();
// Fall thru to "Bytes"
}
if ( currentForm == FORM_OPTIMIZED) {
try {
currentMessageAsBytes =
((ByteArray) currentMessage).toByteArray();
} catch (IOException e) {
throw AxisFault.makeFault(e);
}
try{
setCurrentForm(new String((byte[])currentMessageAsBytes,
currentEncoding),
FORM_STRING);
}catch(UnsupportedEncodingException ue){
setCurrentForm( new String((byte[]) currentMessageAsBytes),
FORM_STRING );
}
if (log.isDebugEnabled()) {
log.debug("Exit: SOAPPart::getAsString(): " + currentMessage);
}
return (String)currentMessage;
}
if ( currentForm == FORM_BYTES ) {
// If the current message was already converted from
// a String to byte[], return the String representation
// (this is done to avoid unnecessary conversions)
if (currentMessage == currentMessageAsBytes &&
currentMessageAsString != null) {
if (log.isDebugEnabled()) {
log.debug("Exit: SOAPPart::getAsString(): " + currentMessageAsString);
}
return currentMessageAsString;
}
// Save this message in case it is requested later in getAsBytes
currentMessageAsBytes = (byte[]) currentMessage;
try{
setCurrentForm(new String((byte[])currentMessage,
currentEncoding),
FORM_STRING);
}catch(UnsupportedEncodingException ue){
setCurrentForm( new String((byte[]) currentMessage),
FORM_STRING );
}
currentMessageAsString = (String) currentMessage;
if (log.isDebugEnabled()) {
log.debug("Exit: SOAPPart::getAsString(): " + currentMessage);
}
return (String)currentMessage;
}
if ( currentForm == FORM_FAULT ) {
StringWriter writer = new StringWriter();
try {
this.writeTo(writer);
} catch (Exception e) {
log.error(Messages.getMessage("exception00"), e);
return null;
}
setCurrentForm(writer.getBuffer().toString(), FORM_STRING);
if (log.isDebugEnabled()) {
log.debug("Exit: SOAPPart::getAsString(): " + currentMessage);
}
return (String)currentMessage;
}
if ( currentForm == FORM_SOAPENVELOPE ) {
StringWriter writer = new StringWriter();
try {
this.writeTo(writer);
} catch (Exception e) {
throw AxisFault.makeFault(e);
}
setCurrentForm(writer.getBuffer().toString(), FORM_STRING);
if (log.isDebugEnabled()) {
log.debug("Exit: SOAPPart::getAsString(): " + currentMessage);
}
return (String)currentMessage;
}
log.error( Messages.getMessage("cantConvert01", ""+currentForm));
log.debug("Exit: SOAPPart::getAsString()");
return null;
|
public org.w3c.dom.NamedNodeMap | getAttributes()
return document.getAttributes();
|
public org.w3c.dom.NodeList | getChildNodes()
return document.getChildNodes();
|
public javax.xml.transform.Source | getContent()Returns the content of the SOAPEnvelope as a JAXP
Source object.
if(contentSource == null) {
switch(currentForm) {
case FORM_STRING:
String s = (String) currentMessage;
contentSource = new StreamSource(new StringReader(s));
break;
case FORM_INPUTSTREAM:
contentSource =
new StreamSource((InputStream) currentMessage);
break;
case FORM_SOAPENVELOPE:
SOAPEnvelope se = (SOAPEnvelope) currentMessage;
try {
contentSource = new DOMSource(se.getAsDocument());
} catch (Exception e) {
throw new SOAPException(Messages.getMessage("errorGetDocFromSOAPEnvelope"),
e);
}
break;
case FORM_OPTIMIZED:
try {
ByteArrayInputStream baos = new ByteArrayInputStream(((ByteArray) currentMessage).toByteArray());
contentSource = new StreamSource(baos);
} catch (IOException e) {
throw new SOAPException(Messages.getMessage("errorGetDocFromSOAPEnvelope"),
e);
}
break;
case FORM_BYTES:
byte[] bytes = (byte[]) currentMessage;
contentSource =
new StreamSource(new ByteArrayInputStream(bytes));
break;
case FORM_BODYINSTREAM:
contentSource =
new StreamSource((InputStream) currentMessage);
break;
}
}
return contentSource;
|
public java.lang.String | getContentId()Content ID.
return getFirstMimeHeader(HTTPConstants.HEADER_CONTENT_ID);
|
public java.lang.String | getContentIdRef()Content ID.
return org.apache.axis.attachments.Attachments.CIDprefix +
getContentId();
|
public long | getContentLength()Get the content length for this SOAPPart.
This will force buffering of the SOAPPart, but it will
also cache the byte[] form of the SOAPPart.
saveChanges();
if (currentForm == FORM_OPTIMIZED) {
return ((ByteArray) currentMessage).size();
} else if (currentForm == FORM_BYTES) {
return ((byte[]) currentMessage).length;
}
byte[] bytes = this.getAsBytes();
return bytes.length;
|
public java.lang.String | getContentLocation()Content location.
return getFirstMimeHeader(HTTPConstants.HEADER_CONTENT_LOCATION);
|
public java.lang.String | getContentType()Content type is always "text/xml" for SOAPParts.
return "text/xml";
|
public int | getCurrentForm()
return currentForm;
|
public java.lang.Object | getCurrentMessage()Get the current message, in whatever form it happens to be right now.
Will return a String, byte[], InputStream, or SOAPEnvelope, depending
on circumstances.
The method name is historical.
TODO: rename this for clarity; should be more like getContents.
return currentMessage;
|
public org.w3c.dom.DocumentType | getDoctype()
return document.getDoctype();
|
public org.w3c.dom.Element | getDocumentElement()
try{
return getEnvelope();
}catch(SOAPException se){
return null;
}
|
public org.w3c.dom.Element | getElementById(java.lang.String elementId)
return document.getElementById(elementId);
|
public org.w3c.dom.NodeList | getElementsByTagName(java.lang.String tagname)
return document.getElementsByTagName(tagname);
|
public org.w3c.dom.NodeList | getElementsByTagNameNS(java.lang.String namespaceURI, java.lang.String localName)
return document.getElementsByTagNameNS(namespaceURI,localName);
|
public java.lang.String | getEncoding()
return currentEncoding;
|
public javax.xml.soap.SOAPEnvelope | getEnvelope()Gets the SOAPEnvelope object associated with
this SOAPPart object. Once the SOAP envelope is
obtained, it can be used to get its contents.
try {
return getAsSOAPEnvelope();
} catch (AxisFault af) {
throw new SOAPException(af);
}
|
public org.w3c.dom.Node | getFirstChild()
return document.getFirstChild();
|
private java.lang.String | getFirstMimeHeader(java.lang.String header)Get the specified MIME header.
String[] values = mimeHeaders.getHeader(header);
if(values != null && values.length>0)
return values[0];
return null;
|
public org.w3c.dom.DOMImplementation | getImplementation()
return document.getImplementation();
|
public org.w3c.dom.Node | getLastChild()
return document.getLastChild();
|
public java.lang.String | getLocalName()
return document.getLocalName();
|
public java.util.Iterator | getMatchingMimeHeaders(java.lang.String[] match)Get all headers that match.
return mimeHeaders.getMatchingHeaders(match);
|
public Message | getMessage()Get the Message for this Part .
return msgObject;
|
public java.lang.String[] | getMimeHeader(java.lang.String name)Gets all the values of the MimeHeader object
in this SOAPPart object that is identified by
the given String .
return mimeHeaders.getHeader(name);
|
public java.lang.String | getNamespaceURI()
return document.getNamespaceURI();
|
public org.w3c.dom.Node | getNextSibling()
return document.getNextSibling();
|
public java.lang.String | getNodeName()Node Implementation
return document.getNodeName();
|
public short | getNodeType()
return document.getNodeType();
|
public java.lang.String | getNodeValue()
return document.getNodeValue();
|
public java.util.Iterator | getNonMatchingMimeHeaders(java.lang.String[] match)Get all headers that do not match.
return mimeHeaders.getNonMatchingHeaders(match);
|
public org.w3c.dom.Document | getOwnerDocument()
return document.getOwnerDocument();
|
public org.w3c.dom.Node | getParentNode()
return document.getParentNode();
|
public java.lang.String | getPrefix()
return document.getPrefix();
|
public org.w3c.dom.Node | getPreviousSibling()
return document.getPreviousSibling();
|
public org.w3c.dom.Document | getSOAPDocument()
if(document == null){
document = new SOAPDocumentImpl(this);
}
return document;
|
public boolean | getStandalone()
throw new UnsupportedOperationException("Not yet implemented.71");
|
public boolean | getStrictErrorChecking()
throw new UnsupportedOperationException("Not yet implemented.73");
|
public java.lang.String | getVersion()
throw new UnsupportedOperationException("Not yet implemented. 75");
|
public boolean | hasAttributes()
return document.hasAttributes();
|
public boolean | hasChildNodes()
return document.hasChildNodes();
|
public org.w3c.dom.Node | importNode(org.w3c.dom.Node importedNode, boolean deep)
return document.importNode(importedNode, deep);
|
public org.w3c.dom.Node | insertBefore(org.w3c.dom.Node newChild, org.w3c.dom.Node refChild)
return document.insertBefore(newChild, refChild);
|
public boolean | isBodyStream()
return (currentForm == SOAPPart.FORM_INPUTSTREAM || currentForm == SOAPPart.FORM_BODYINSTREAM);
|
private boolean | isFormOptimizationAllowed()check if the allow optimization flag is on
boolean allowFormOptimization = true;
Message msg = getMessage();
if (msg != null) {
MessageContext ctx = msg.getMessageContext();
if (ctx != null) {
Boolean propFormOptimization = (Boolean)ctx.getProperty(ALLOW_FORM_OPTIMIZATION);
if (propFormOptimization != null) {
allowFormOptimization = propFormOptimization.booleanValue();
}
}
}
return allowFormOptimization;
|
public boolean | isSupported(java.lang.String feature, java.lang.String version)
return document.isSupported(feature, version);
|
public void | normalize()
document.normalize();
|
public void | removeAllMimeHeaders()Removes all the MimeHeader objects for this
SOAPEnvelope object.
mimeHeaders.removeAllHeaders();
|
public org.w3c.dom.Node | removeChild(org.w3c.dom.Node oldChild)
return document.removeChild(oldChild);
|
public void | removeMimeHeader(java.lang.String header)Removes all MIME headers that match the given name.
mimeHeaders.removeHeader(header);
|
public org.w3c.dom.Node | replaceChild(org.w3c.dom.Node newChild, org.w3c.dom.Node oldChild)
return document.replaceChild(newChild, oldChild);
|
public void | saveChanges()
log.debug("Enter: SOAPPart::saveChanges");
if ( currentForm == FORM_SOAPENVELOPE ||
currentForm == FORM_FAULT ){
currentEncoding = XMLUtils.getEncoding(msgObject, null);
ByteArray array = new ByteArray();
try {
writeTo(array);
array.flush();
} catch (Exception e) {
throw AxisFault.makeFault(e);
}
setCurrentForm( array, FORM_OPTIMIZED );
if (log.isDebugEnabled()) {
log.debug("Exit: SOAPPart::saveChanges(): " + currentMessage);
}
}
|
public void | setContent(javax.xml.transform.Source source)Sets the content of the SOAPEnvelope object
with the data from the given Source object.
if(source == null)
throw new SOAPException(Messages.getMessage("illegalArgumentException00"));
// override the checks in HandlerChainImpl for JAXRPCHandler kludge
MessageContext ctx = getMessage().getMessageContext();
if (ctx != null) {
ctx.setProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION,
Boolean.TRUE);
}
contentSource = source;
InputSource in = org.apache.axis.utils.XMLUtils.sourceToInputSource(contentSource);
InputStream is = in.getByteStream();
if(is != null) {
setCurrentMessage(is, FORM_INPUTSTREAM);
} else {
Reader r = in.getCharacterStream();
if(r == null) {
throw new SOAPException(Messages.getMessage("noCharacterOrByteStream"));
}
BufferedReader br = new BufferedReader(r);
String line = null;
StringBuffer sb = new StringBuffer();
try {
while((line = br.readLine()) != null) {
sb.append(line);
}
} catch (IOException e) {
throw new SOAPException(Messages.getMessage("couldNotReadFromCharStream"), e);
}
setCurrentMessage(sb.toString(), FORM_STRING);
}
|
public void | setContentId(java.lang.String newCid)Sets Content-Id of this part.
already defined.
setMimeHeader(HTTPConstants.HEADER_CONTENT_ID,newCid);
|
public void | setContentLocation(java.lang.String loc)Set content location.
setMimeHeader(HTTPConstants.HEADER_CONTENT_LOCATION, loc);
|
private void | setCurrentForm(java.lang.Object currMsg, int form)Set the current contents of this Part.
The method name is historical.
TODO: rename this for clarity to something more like setContents???
if (log.isDebugEnabled()) {
String msgStr;
if (currMsg instanceof String) {
msgStr = (String)currMsg;
} else {
msgStr = currMsg.getClass().getName();
}
log.debug(Messages.getMessage("setMsgForm", formNames[form],
"" + msgStr));
}
// only change form if allowed
if (isFormOptimizationAllowed()) {
currentMessage = currMsg;
currentForm = form;
if (currentForm == FORM_SOAPENVELOPE) {
currentMessageAsEnvelope = (org.apache.axis.message.SOAPEnvelope) currMsg;
}
}
|
public void | setCurrentMessage(java.lang.Object currMsg, int form)Set the current message
currentMessageAsString = null; //Get rid of any cached stuff this is new.
currentMessageAsBytes = null;
currentMessageAsEnvelope= null;
setCurrentForm(currMsg, form);
|
public void | setEncoding(java.lang.String s)
currentEncoding = s;
|
public void | setMessage(Message msg)Set the Message for this Part.
Do not call this Directly. Called by Message.
this.msgObject= msg;
|
public void | setMimeHeader(java.lang.String name, java.lang.String value)Changes the first header entry that matches the given
header name so that its value is the given value, adding a
new header with the given name and value if no existing
header is a match. If there is a match, this method clears
all existing values for the first header that matches and
sets the given value instead. If more than one header has
the given name, this method removes all of the matching
headers after the first one.
Note that RFC822 headers can contain only US-ASCII
characters.
mimeHeaders.setHeader(name,value);
|
public void | setNodeValue(java.lang.String nodeValue)
document.setNodeValue(nodeValue);
|
public void | setPrefix(java.lang.String prefix)
document.setPrefix(prefix);
|
public void | setSOAPEnvelope(org.apache.axis.message.SOAPEnvelope env)This set the SOAP Envelope for this part.
Note: It breaks the chicken/egg created.
I need a message to create an attachment...
From the attachment I should be able to get a reference...
I now want to edit elements in the envelope in order to
place the attachment reference to it.
How do I now update the SOAP envelope with what I've changed?
setCurrentMessage(env, FORM_SOAPENVELOPE) ;
|
public void | setStandalone(boolean flag)
throw new UnsupportedOperationException("Not yet implemented.72");
|
public void | setStrictErrorChecking(boolean flag)
throw new UnsupportedOperationException("Not yet implemented. 74");
|
public void | setVersion(java.lang.String s)
throw new UnsupportedOperationException("Not yet implemented.76");
|
public void | writeTo(java.io.OutputStream os)Write the contents to the specified stream.
if ( currentForm == FORM_BYTES ) {
os.write((byte[])currentMessage);
} else if ( currentForm == FORM_OPTIMIZED ) {
((ByteArray) currentMessage).writeTo(os);
} else {
Writer writer = new OutputStreamWriter(os, currentEncoding);
writer = new BufferedWriter(new PrintWriter(writer));
writeTo(writer);
writer.flush();
}
|
public void | writeTo(java.io.Writer writer)Write the contents to the specified writer.
boolean inclXmlDecl = false;
if (msgObject.getMessageContext() != null) { // if we have message context (JAX-RPC), write xml decl always.
inclXmlDecl = true;
} else { // if we have no message context (SAAJ), write xml decl according to property.
try {
String xmlDecl = (String)msgObject.getProperty(SOAPMessage.WRITE_XML_DECLARATION);
if (xmlDecl != null && xmlDecl.equals("true")) {
inclXmlDecl = true;
}
} catch (SOAPException e) {
throw new IOException(e.getMessage());
}
}
if ( currentForm == FORM_FAULT ) {
AxisFault env = (AxisFault)currentMessage;
try {
SerializationContext serContext = new SerializationContext(writer, getMessage().getMessageContext());
serContext.setSendDecl(inclXmlDecl);
serContext.setEncoding(currentEncoding);
env.output(serContext);
} catch (Exception e) {
log.error(Messages.getMessage("exception00"), e);
throw env;
}
return;
}
if ( currentForm == FORM_SOAPENVELOPE ) {
SOAPEnvelope env = (SOAPEnvelope)currentMessage;
try {
SerializationContext serContext = new SerializationContext(writer, getMessage().getMessageContext());
serContext.setSendDecl(inclXmlDecl);
serContext.setEncoding(currentEncoding);
env.output(serContext);
} catch (Exception e) {
throw AxisFault.makeFault(e);
}
return;
}
String xml = this.getAsString();
if(inclXmlDecl){
if(!xml.startsWith("<?xml")){
writer.write("<?xml version=\"1.0\" encoding=\"");
writer.write(currentEncoding);
writer.write("\"?>");
}
}
writer.write(xml);
|