Tabnine Logo
HTTPTransportUtils
Code IndexAdd Tabnine to your IDE (free)

How to use
HTTPTransportUtils
in
org.apache.axis2.transport.http

Best Java code snippets using org.apache.axis2.transport.http.HTTPTransportUtils (Showing top 20 results out of 315)

origin: org.apache.synapse/synapse-core

/**
 * Whether the original request received by the synapse is REST
 *
 * @param originalInMsgCtx request message
 * @return <code>true</code> if the request was a REST request
 */
private static boolean isRequestRest(org.apache.axis2.context.MessageContext originalInMsgCtx) {
  boolean isRestRequest =
      originalInMsgCtx.getProperty(NhttpConstants.REST_REQUEST_CONTENT_TYPE) != null;
  if (!isRestRequest) {
    String httpMethod = (String) originalInMsgCtx.getProperty(
        Constants.Configuration.HTTP_METHOD);
    isRestRequest = Constants.Configuration.HTTP_METHOD_GET.equals(httpMethod)
            || Constants.Configuration.HTTP_METHOD_DELETE.equals(httpMethod)
            || Constants.Configuration.HTTP_METHOD_PUT.equals(httpMethod)
            || RESTConstants.METHOD_OPTIONS.equals(httpMethod);
    if (!isRestRequest) {
      isRestRequest = Constants.Configuration.HTTP_METHOD_POST.equals(httpMethod)
              && HTTPTransportUtils.isRESTRequest(
          String.valueOf(originalInMsgCtx.getProperty(
              Constants.Configuration.MESSAGE_TYPE)));
    }
  }
  return isRestRequest;
}
origin: org.apache.axis2/axis2-transport-http

public EndpointReference[] getEPRsForService(String serviceName, String ip) throws AxisFault {
  if (port == -1) {
    throw new AxisFault("Port number for transport " + scheme + " has not yet been detected");
  }
  return HTTPTransportUtils.getEPRsForService(configurationContext, transportInDescription,
      serviceName, ip, port);
}
origin: org.apache.axis2/axis2-transport-http

public void processExplicitSchemaAndWSDL(HttpServletRequest req,
                     HttpServletResponse res)
    throws IOException, ServletException {
  HashMap<String, AxisService> services = configContext.getAxisConfiguration().getServices();
  String filePart = req.getRequestURL().toString();
  String schema = filePart.substring(filePart.lastIndexOf("/") + 1,
                    filePart.length());
  if ((services != null) && !services.isEmpty()) {
    Iterator<AxisService> i = services.values().iterator();
    while (i.hasNext()) {
      AxisService service = (AxisService) i.next();
      InputStream stream = HTTPTransportUtils.getMetaInfResourceAsStream(service, schema);
      if (stream != null) {
        OutputStream out = res.getOutputStream();
        res.setContentType("text/xml");
        IOUtils.copy(stream, out, true);
        return;
      }
    }
  }
}
origin: wso2/wso2-synapse

/**
 *
 */
private void processEntityEnclosingMethod() {
  try {
    Header contentType = request.getFirstHeader(HTTP.CONTENT_TYPE);
    String contentTypeStr = contentType != null ?
        contentType.getValue() : inferContentType();
    String charSetEncoding = BuilderUtil.getCharSetEncoding(contentTypeStr);
    msgContext.setProperty(
        Constants.Configuration.CHARACTER_SET_ENCODING, charSetEncoding);
    if (HTTPTransportUtils.isRESTRequest(contentTypeStr) || isRest(contentTypeStr)) {
      RESTUtil.processPOSTRequest(msgContext, is, os,
          request.getRequestLine().getUri(), contentTypeStr, isRestDispatching);
    } else {
      Header soapAction  = request.getFirstHeader(SOAPACTION);
      HTTPTransportUtils.processHTTPPostRequest(
          msgContext, is,
          os,
          contentTypeStr,
          (soapAction != null  ? soapAction.getValue()  : null),
          request.getRequestLine().getUri());
    }
  } catch (Exception e) {
    handleException("Error processing POST request ", e);
  }
}
origin: apache/axis2-java

        while (i.hasNext()) {
          AxisService service = (AxisService) i.next();
          InputStream stream = HTTPTransportUtils.getMetaInfResourceAsStream(service, file);
          if (stream != null) {
            OutputStream out = response.getOutputStream();
      return;
    } else {
      InputStream instream = HTTPTransportUtils.getMetaInfResourceAsStream(service, schemaName);
if (HTTPTransportUtils.isRESTRequest(contentType)) {
  pi = RESTUtil.processXMLRequest(
      msgContext, 
    uri = ip + uri;
  pi = HTTPTransportUtils.processHTTPPostRequest(
      msgContext, 
      request.getInputStream(),
origin: org.apache.axis2/axis2-transport-http

int soapVersion = VERSION_UNKNOWN;
try {
  soapVersion = initializeMessageContext(msgContext, soapActionHeader, requestURI, contentType);
  msgContext.setProperty(MessageContext.TRANSPORT_OUT, out);
      TransportUtils.createSOAPMessage(
          msgContext,
          handleGZip(msgContext, in), 
          contentType));
  return AxisEngine.receive(msgContext);
origin: wso2/wso2-synapse

msgContext.setProperty(Constants.Configuration.MESSAGE_TYPE, contentType);
if (contentTypeHeader == null || HTTPTransportUtils.isRESTRequest(contentTypeHeader) || isRest(contentTypeHeader)) {
  msgContext.setProperty(PassThroughConstants.REST_REQUEST_CONTENT_TYPE, contentType);
  msgContext.setDoingREST(true);
      initializeMessageContext(msgContext, soapAction,
          request.getUri(), contentTypeHeader);
  SOAPEnvelope envelope;
origin: wso2/wso2-synapse

envelope = TransportUtils.createSOAPMessage(
    responseMsgCtx,
    HTTPTransportUtils.handleGZip(responseMsgCtx, in),
    contentType);
origin: org.apache.axis2/axis2-transport-http

msgContext.setProperty(MessageContext.TRANSPORT_OUT, out);
msgContext.setServerSide(true);
SOAPEnvelope envelope = HTTPTransportUtils.createEnvelopeFromGetRequest(requestURI,
                                    requestParameters,
                                    configurationContext);
origin: org.apache.axis2/axis2-transport-http

OutputStream out = response.getOutputStream();
String contentType = request.getContentType();
if (!HTTPTransportUtils.isRESTRequest(contentType)) {
  msgContext = createMessageContext(request, response);
  msgContext.setProperty(Constants.Configuration.CONTENT_TYPE, contentType);
        processHTTPPostRequest(msgContext,
            new BufferedInputStream(request.getInputStream()),
            bufferedOut,
origin: org.apache.axis2/axis2-transport-http

        while (i.hasNext()) {
          AxisService service = (AxisService) i.next();
          InputStream stream = HTTPTransportUtils.getMetaInfResourceAsStream(service, file);
          if (stream != null) {
            OutputStream out = response.getOutputStream();
      return;
    } else {
      InputStream instream = HTTPTransportUtils.getMetaInfResourceAsStream(service, schemaName);
if (HTTPTransportUtils.isRESTRequest(contentType)) {
  pi = RESTUtil.processXMLRequest(
      msgContext, 
    uri = ip + uri;
  pi = HTTPTransportUtils.processHTTPPostRequest(
      msgContext, 
      request.getInputStream(),
origin: apache/axis2-java

int soapVersion = VERSION_UNKNOWN;
try {
  soapVersion = initializeMessageContext(msgContext, soapActionHeader,
      requestURI, contentType);
  msgContext.setProperty(MessageContext.TRANSPORT_OUT, out);
      TransportUtils.createSOAPMessage(
          msgContext,
          handleGZip(msgContext, in),
          contentType, builder));
  return AxisEngine.receive(msgContext);
origin: org.apache.axis2/axis2-transport-http

msgContext.setProperty(Constants.Configuration.CHARACTER_SET_ENCODING, charSetEncoding);
dispatchAndVerify(msgContext);
in = HTTPTransportUtils.handleGZip(msgContext, in);
SOAPEnvelope soapEnvelope;
if (msgContext.getAxisService() == null) {
origin: apache/axis2-java

msgContext.setProperty(MessageContext.TRANSPORT_OUT, out);
msgContext.setServerSide(true);
SOAPEnvelope envelope = HTTPTransportUtils.createEnvelopeFromGetRequest(requestURI,
                                    requestParameters,
                                    configurationContext);
origin: apache/axis2-java

OutputStream out = response.getOutputStream();
String contentType = request.getContentType();
if (!HTTPTransportUtils.isRESTRequest(contentType)) {
  msgContext = createMessageContext(request, response);
  msgContext.setProperty(Constants.Configuration.CONTENT_TYPE, contentType);
        processHTTPPostRequest(msgContext,
            new BufferedInputStream(request.getInputStream()),
            bufferedOut,
origin: org.apache.axis2/axis2-transport-http

int soapVersion = VERSION_UNKNOWN;
try {
  soapVersion = initializeMessageContext(msgContext, soapActionHeader,
      requestURI, contentType);
  msgContext.setProperty(MessageContext.TRANSPORT_OUT, out);
      TransportUtils.createSOAPMessage(
          msgContext,
          handleGZip(msgContext, in),
          contentType, builder));
  return AxisEngine.receive(msgContext);
origin: org.apache.synapse/synapse-core

&& HTTPTransportUtils.isRESTRequest(
String.valueOf(originalInMsgCtx.getProperty(
    Constants.Configuration.MESSAGE_TYPE)));
origin: apache/axis2-java

msgContext.setProperty(Constants.Configuration.CHARACTER_SET_ENCODING, charSetEncoding);
dispatchAndVerify(msgContext);
in = HTTPTransportUtils.handleGZip(msgContext, in);
SOAPEnvelope soapEnvelope;
if (msgContext.getAxisService() == null) {
origin: apache/axis2-java

public EndpointReference[] getEPRsForService(String serviceName, String ip) throws AxisFault {
  if (port == -1) {
    throw new AxisFault("Port number for transport " + scheme + " has not yet been detected");
  }
  return HTTPTransportUtils.getEPRsForService(configurationContext, transportInDescription,
      serviceName, ip, port);
}
origin: apache/axis2-java

public void processExplicitSchemaAndWSDL(HttpServletRequest req,
                     HttpServletResponse res)
    throws IOException, ServletException {
  HashMap<String, AxisService> services = configContext.getAxisConfiguration().getServices();
  String filePart = req.getRequestURL().toString();
  String schema = filePart.substring(filePart.lastIndexOf("/") + 1,
                    filePart.length());
  if ((services != null) && !services.isEmpty()) {
    Iterator<AxisService> i = services.values().iterator();
    while (i.hasNext()) {
      AxisService service = (AxisService) i.next();
      InputStream stream = HTTPTransportUtils.getMetaInfResourceAsStream(service, schema);
      if (stream != null) {
        OutputStream out = res.getOutputStream();
        res.setContentType("text/xml");
        IOUtils.copy(stream, out, true);
        return;
      }
    }
  }
}
org.apache.axis2.transport.httpHTTPTransportUtils

Most used methods

  • isRESTRequest
    This will match for content types that will be regarded as REST in WSDL2.0. This contains, 1. applic
  • handleGZip
  • initializeMessageContext
  • processHTTPPostRequest
  • createEnvelopeFromGetRequest
  • getEPRsForService
  • getMetaInfResourceAsStream

Popular in Java

  • Running tasks concurrently on multiple threads
  • requestLocationUpdates (LocationManager)
  • startActivity (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Menu (java.awt)
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • JTextField (javax.swing)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now