Package org.jboss.soa.esb.http

Examples of org.jboss.soa.esb.http.HttpRequest


            method.setRequestHeader("Content-Type", "text/xml;charset=UTF-8") ;
        }
    }
   
  private void setMappedHttpHeaders(HttpMethodBase method, Message message) {
      HttpRequest request = HttpRequest.getRequest(message);
      Properties properties = message.getProperties();
      for (String headerName : mappedHeaderList) {
        String headerValue = null;
        if (request != null) {
          headerValue = getHttpHeaderValue(request, headerName);
View Full Code Here


        } else {
            payloadProxy.setPayload(message, bodyBytes);
        }

        //Get the http request info and set it on the message...
        HttpRequest requestInfo = getRequestInfo(request);
        requestInfo.setRequest(message);
    }
View Full Code Here

   * @return Request information includes the http header and other information parsed by
   *         servlet container from a servlet request
   */
  @SuppressWarnings("unchecked")
  public HttpRequest getRequestInfo(HttpServletRequest request) {
        HttpRequest requestInfo = new org.jboss.soa.esb.http.HttpRequest();

        requestInfo.setAuthType(request.getAuthType());
        requestInfo.setCharacterEncoding(request.getCharacterEncoding());
        requestInfo.setContentType(request.getContentType());
        requestInfo.setContextPath(request.getContextPath());
        requestInfo.setLocalAddr(request.getLocalAddr());
        requestInfo.setLocalName(getLocalName(request));
        requestInfo.setMethod(request.getMethod());
        requestInfo.setProtocol(request.getProtocol());
        requestInfo.setQueryString(request.getQueryString());
        requestInfo.setRemoteAddr(request.getRemoteAddr());
        requestInfo.setRemoteHost(request.getRemoteHost());
        requestInfo.setRemoteUser(request.getRemoteUser());
        requestInfo.setContentLength(request.getContentLength());
        requestInfo.setRequestSessionId(request.getRequestedSessionId());
        requestInfo.setRequestURI(request.getRequestURI());
        requestInfo.setScheme(request.getScheme());
        requestInfo.setServerName(request.getServerName());
        requestInfo.setRequestPath(request.getServletPath());

        String pathInfo = request.getPathInfo();
        requestInfo.setPathInfo(pathInfo);

        if(pathInfo != null) {
            List<String> pathInfoTokens = requestInfo.getPathInfoTokens();

            pathInfoTokens.addAll(Arrays.asList(request.getPathInfo().split("/")));

            // remove empty tokens...
            Iterator<String> tokensIterator = pathInfoTokens.iterator();
            while(tokensIterator.hasNext()) {
                if(tokensIterator.next().trim().length() == 0) {
                    tokensIterator.remove();
                }
            }
        }

        // Http Query params...
        Map paramMap = request.getParameterMap();
        if(paramMap != null) {
            requestInfo.getQueryParams().putAll(paramMap);
        }

        // Http headers...
        Enumeration enumeration = request.getHeaderNames();
    while (enumeration.hasMoreElements()) {
      String name = (String) enumeration.nextElement();
      String value = request.getHeader(name);
      requestInfo.getHeaders().add(new HttpHeader(name, value));
    }

        return requestInfo;
  }
View Full Code Here

    }
  }
 
  public Message process(Message message) throws ActionProcessingException
  {
    HttpRequest request = HttpRequest.getRequest(message);
    String soapaction = (request != null) ? request.getHeaderValue("soapaction") : null;
    if (soapaction == null)
    {
      soapaction = (String)message.getProperties().getProperty("soapaction");
    }
    QName element = null;
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.http.HttpRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.