org.apache.axis2.transport
Class TransportUtils

java.lang.Object
  extended by org.apache.axis2.transport.TransportUtils

public class TransportUtils
extends java.lang.Object


Constructor Summary
TransportUtils()
           
 
Method Summary
static org.apache.axiom.om.OMElement createDocumentElement(java.lang.String contentType, MessageContext msgContext, java.io.InputStream inStream)
           
static org.apache.axiom.soap.SOAPEnvelope createSOAPEnvelope(org.apache.axiom.om.OMElement documentElement)
           
static org.apache.axiom.soap.SOAPEnvelope createSOAPMessage(MessageContext msgContext)
           
static org.apache.axiom.soap.SOAPEnvelope createSOAPMessage(MessageContext msgContext, java.io.InputStream inStream, java.lang.String contentType)
          Objective of this method is to capture the SOAPEnvelope creation logic and make it a common for all the transports and to in/out flows.
static void deleteAttachments(MessageContext msgContext)
          Clean up cached attachment file
static java.lang.String getCharSetEncoding(java.lang.String contentType)
          Extracts and returns the character set encoding from the Content-type header Example: Content-Type: text/xml; charset=utf-8
static MessageFormatter getMessageFormatter(MessageContext msgContext)
          Initial work for a builder selector which selects the builder for a given message format based on the the content type of the recieved message.
static boolean isResponseWritten(MessageContext messageContext)
          This is a helper method to get the response written flag from the RequestResponseTransport instance.
static void processContentTypeForAction(java.lang.String contentType, MessageContext msgContext)
           
static void setResponseWritten(MessageContext messageContext, boolean responseWritten)
          This is a helper method to set the response written flag on the RequestResponseTransport instance.
static void writeMessage(MessageContext msgContext, java.io.OutputStream out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransportUtils

public TransportUtils()
Method Detail

createSOAPMessage

public static org.apache.axiom.soap.SOAPEnvelope createSOAPMessage(MessageContext msgContext)
                                                            throws AxisFault
Throws:
AxisFault

createSOAPMessage

public static org.apache.axiom.soap.SOAPEnvelope createSOAPMessage(MessageContext msgContext,
                                                                   java.io.InputStream inStream,
                                                                   java.lang.String contentType)
                                                            throws AxisFault,
                                                                   org.apache.axiom.om.OMException,
                                                                   javax.xml.stream.XMLStreamException,
                                                                   javax.xml.parsers.FactoryConfigurationError
Objective of this method is to capture the SOAPEnvelope creation logic and make it a common for all the transports and to in/out flows.

Parameters:
msgContext -
inStream -
contentType -
Returns:
the SOAPEnvelope
Throws:
AxisFault
org.apache.axiom.om.OMException
javax.xml.stream.XMLStreamException
javax.xml.parsers.FactoryConfigurationError

createSOAPEnvelope

public static org.apache.axiom.soap.SOAPEnvelope createSOAPEnvelope(org.apache.axiom.om.OMElement documentElement)

createDocumentElement

public static org.apache.axiom.om.OMElement createDocumentElement(java.lang.String contentType,
                                                                  MessageContext msgContext,
                                                                  java.io.InputStream inStream)
                                                           throws AxisFault,
                                                                  javax.xml.stream.XMLStreamException
Throws:
AxisFault
javax.xml.stream.XMLStreamException

getCharSetEncoding

public static java.lang.String getCharSetEncoding(java.lang.String contentType)
Extracts and returns the character set encoding from the Content-type header Example: Content-Type: text/xml; charset=utf-8

Parameters:
contentType -

writeMessage

public static void writeMessage(MessageContext msgContext,
                                java.io.OutputStream out)
                         throws AxisFault
Throws:
AxisFault

getMessageFormatter

public static MessageFormatter getMessageFormatter(MessageContext msgContext)
                                            throws AxisFault
Initial work for a builder selector which selects the builder for a given message format based on the the content type of the recieved message. content-type to builder mapping can be specified through the Axis2.xml.

Parameters:
msgContext -
Returns:
the builder registered against the given content-type
Throws:
AxisFault

processContentTypeForAction

public static void processContentTypeForAction(java.lang.String contentType,
                                               MessageContext msgContext)

isResponseWritten

public static boolean isResponseWritten(MessageContext messageContext)
This is a helper method to get the response written flag from the RequestResponseTransport instance.


setResponseWritten

public static void setResponseWritten(MessageContext messageContext,
                                      boolean responseWritten)
This is a helper method to set the response written flag on the RequestResponseTransport instance.


deleteAttachments

public static void deleteAttachments(MessageContext msgContext)
Clean up cached attachment file

Parameters:
msgContext -


Copyright © 2007 Apache Web Services Project. All Rights Reserved.