Class HTTPTransportUtils

java.lang.Object
org.apache.axis2.transport.http.HTTPTransportUtils

public class HTTPTransportUtils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.axiom.soap.SOAPEnvelope
    createEnvelopeFromGetRequest(String requestUrl, Map map, org.apache.axis2.context.ConfigurationContext configCtx)
    Deprecated.
    This was used only by the now deprecated processHTTPGetRequest() method.
    static org.apache.axis2.addressing.EndpointReference[]
    getEPRsForService(org.apache.axis2.context.ConfigurationContext configurationContext, org.apache.axis2.description.TransportInDescription trpInDesc, String serviceName, String ip, int port)
     
    handleGZip(org.apache.axis2.context.MessageContext msgContext, InputStream in)
     
    static int
    initializeMessageContext(org.apache.axis2.context.MessageContext msgContext, String soapActionHeader, String requestURI, String contentType)
     
    static boolean
    isJSONRequest(String contentType)
    This will match for content types that will be regarded as JSON This contains, 1. application/json
    static boolean
    isRESTRequest(String contentType)
    This will match for content types that will be regarded as REST in WSDL2.0.
    static boolean
    processHTTPGetRequest(org.apache.axis2.context.MessageContext msgContext, OutputStream out, String soapAction, String requestURI, org.apache.axis2.context.ConfigurationContext configurationContext, Map requestParameters)
    Deprecated.
    use RESTUtil.processURLRequest(MessageContext msgContext, OutputStream out, String contentType) instead
    static org.apache.axis2.engine.Handler.InvocationResponse
    processHTTPPostRequest(org.apache.axis2.context.MessageContext msgContext, InputStream in, OutputStream out, String contentType, String soapActionHeader, String requestURI)
     
    static org.apache.axis2.engine.Handler.InvocationResponse
    processHTTPPostRequest(org.apache.axis2.context.MessageContext msgContext, InputStream in, OutputStream out, String contentType, org.apache.axis2.builder.Builder builder, String soapActionHeader, String requestURI)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HTTPTransportUtils

      public HTTPTransportUtils()
  • Method Details

    • createEnvelopeFromGetRequest

      public static org.apache.axiom.soap.SOAPEnvelope createEnvelopeFromGetRequest(String requestUrl, Map map, org.apache.axis2.context.ConfigurationContext configCtx) throws org.apache.axis2.AxisFault
      Deprecated.
      This was used only by the now deprecated processHTTPGetRequest() method.
      Parameters:
      requestUrl - the request url
      map - the map of url parameters
      configCtx - axis ConfigurationContext
      Returns:
      the SOAPEnvelope object
      Throws:
      org.apache.axis2.AxisFault - if an error occurs
    • processHTTPGetRequest

      public static boolean processHTTPGetRequest(org.apache.axis2.context.MessageContext msgContext, OutputStream out, String soapAction, String requestURI, org.apache.axis2.context.ConfigurationContext configurationContext, Map requestParameters) throws org.apache.axis2.AxisFault
      Deprecated.
      use RESTUtil.processURLRequest(MessageContext msgContext, OutputStream out, String contentType) instead
      Parameters:
      msgContext - - The MessageContext of the Request Message
      out - - The output stream of the response
      soapAction - - SoapAction of the request
      requestURI - - The URL that the request came to
      configurationContext - - The Axis Configuration Context
      requestParameters - - The parameters of the request message
      Returns:
      - boolean indication whether the operation was succesfull
      Throws:
      org.apache.axis2.AxisFault - - Thrown in case a fault occurs
    • processHTTPPostRequest

      public static org.apache.axis2.engine.Handler.InvocationResponse processHTTPPostRequest(org.apache.axis2.context.MessageContext msgContext, InputStream in, OutputStream out, String contentType, String soapActionHeader, String requestURI) throws org.apache.axis2.AxisFault
      Throws:
      org.apache.axis2.AxisFault
    • processHTTPPostRequest

      public static org.apache.axis2.engine.Handler.InvocationResponse processHTTPPostRequest(org.apache.axis2.context.MessageContext msgContext, InputStream in, OutputStream out, String contentType, org.apache.axis2.builder.Builder builder, String soapActionHeader, String requestURI) throws org.apache.axis2.AxisFault
      Throws:
      org.apache.axis2.AxisFault
    • initializeMessageContext

      public static int initializeMessageContext(org.apache.axis2.context.MessageContext msgContext, String soapActionHeader, String requestURI, String contentType)
    • handleGZip

      public static InputStream handleGZip(org.apache.axis2.context.MessageContext msgContext, InputStream in) throws IOException
      Throws:
      IOException
    • isRESTRequest

      public static boolean isRESTRequest(String contentType)
      This will match for content types that will be regarded as REST in WSDL2.0. This contains, 1. application/xml 2. application/x-www-form-urlencoded 3. multipart/form-data

      If the request doesnot contain a content type; this will return true.

      Parameters:
      contentType - content type to check
      Returns:
      Boolean
    • isJSONRequest

      public static boolean isJSONRequest(String contentType)
      This will match for content types that will be regarded as JSON This contains, 1. application/json

      If the request does not contain a content type, this will return false.

      Parameters:
      contentType - content type to check
      Returns:
      Boolean
    • getEPRsForService

      public static org.apache.axis2.addressing.EndpointReference[] getEPRsForService(org.apache.axis2.context.ConfigurationContext configurationContext, org.apache.axis2.description.TransportInDescription trpInDesc, String serviceName, String ip, int port) throws org.apache.axis2.AxisFault
      Throws:
      org.apache.axis2.AxisFault