org.apache.synapse.transport.nhttp.util
Class RESTUtil

java.lang.Object
  extended by org.apache.synapse.transport.nhttp.util.RESTUtil

public class RESTUtil
extends Object

This class provides a set of utility methods to manage the REST invocation calls going out from the nhttp transport in the HTTP GET method


Constructor Summary
RESTUtil()
           
 
Method Summary
static String getURI(MessageContext messageContext, String address)
          This method will return the URI part for the GET HTTPRequest by converting the SOAP infoset to the URL-encoded GET format
static void processGetAndDeleteRequest(MessageContext msgContext, OutputStream out, String requestURI, org.apache.http.Header contentTypeHeader, String httpMethod, boolean dispatching)
          Processes the HTTP GET / DELETE request and builds the SOAP info-set of the REST message
static void processPOSTRequest(MessageContext msgContext, InputStream is, OutputStream os, String requestURI, org.apache.http.Header contentTypeHeader, boolean dispatching)
          Processes the HTTP POST request and builds the SOAP info-set of the REST message
static void processURLRequest(MessageContext msgContext, OutputStream out, String soapAction, String requestURI)
          Processes the HTTP GET request and builds the SOAP info-set of the REST message
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RESTUtil

public RESTUtil()
Method Detail

getURI

public static String getURI(MessageContext messageContext,
                            String address)
                     throws AxisFault
This method will return the URI part for the GET HTTPRequest by converting the SOAP infoset to the URL-encoded GET format

Parameters:
messageContext - - from which the SOAP infoset will be extracted to encode
address - - address of the actual service
Returns:
uri - ERI of the GET request
Throws:
AxisFault - - if the SOAP infoset cannot be converted in to the GET URL-encoded format

processGetAndDeleteRequest

public static void processGetAndDeleteRequest(MessageContext msgContext,
                                              OutputStream out,
                                              String requestURI,
                                              org.apache.http.Header contentTypeHeader,
                                              String httpMethod,
                                              boolean dispatching)
                                       throws AxisFault
Processes the HTTP GET / DELETE request and builds the SOAP info-set of the REST message

Parameters:
msgContext - The MessageContext of the Request Message
out - The output stream of the response
requestURI - The URL that the request came to
contentTypeHeader - The contentType header of the request
httpMethod - The http method of the request
dispatching - Weather we should do service dispatching
Throws:
AxisFault - - Thrown in case a fault occurs

processURLRequest

public static void processURLRequest(MessageContext msgContext,
                                     OutputStream out,
                                     String soapAction,
                                     String requestURI)
                              throws AxisFault
Processes the HTTP GET request and builds the SOAP info-set of the REST message

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
Throws:
AxisFault - - Thrown in case a fault occurs

processPOSTRequest

public static void processPOSTRequest(MessageContext msgContext,
                                      InputStream is,
                                      OutputStream os,
                                      String requestURI,
                                      org.apache.http.Header contentTypeHeader,
                                      boolean dispatching)
                               throws AxisFault
Processes the HTTP POST request and builds the SOAP info-set of the REST message

Parameters:
msgContext - The MessageContext of the Request Message
is - The input stream of the request
os - The output stream of the response
requestURI - The URL that the request came to
contentTypeHeader - The contentType header of the request
dispatching - Weather we should do dispatching
Throws:
AxisFault - - Thrown in case a fault occurs


Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.