Package org.jboss.wsf.spi.invocation

Examples of org.jboss.wsf.spi.invocation.RequestHandler


        soapMessage = getSOAPMessagePayload(message);
        try {
            messageTL.set(message);

            RequestHandler requestHandler = endpoint.getRequestHandler();

            final Map<String, List<String>> headers = new HashMap<String, List<String>>() ;
            final Properties properties = message.getProperties() ;
            final String[] names = properties.getNames() ;
            for(final String name: names)
            {
                final Object value = properties.getProperty(name) ;
                if (value != null)
                {
                    String normalisedName = name.toLowerCase() ;

                    if ("content-type".equals(normalisedName))
                    {
                        if ("application/octet-stream".equals(value))
                        {
                            continue;
                        }
                        else
                        {
                            // CXF needs it to be case sensitive
                            normalisedName = "Content-Type";
                        }
                    }

                    final List<String> values = headers.get(normalisedName) ;
                    if (values == null)
                    {
                        final List<String> newValues = new ArrayList<String>() ;
                        newValues.add(value.toString()) ;
                        headers.put(normalisedName, newValues) ;
                    }
                    else
                    {
                        values.add(value.toString()) ;
                    }
                }
            }

            //CXF throws NPE in handler if content-length not set
            List<String> newValues = new ArrayList<String>();
            newValues.add(String.valueOf(soapMessage.length));
            headers.put("content-length", newValues);

            final String endpointAddress = endpoint.getAddress() ;
            String path = null ;
            if (endpointAddress != null)
            {
                try
                {
                    path = new URI(endpointAddress).getPath() ;
                }
                catch (final URISyntaxException urise) {} //ignore
            }
            if (path == null)
            {
                path = getHeaderValue(headers, "path") ;
            }

            final SOAPProcessorHttpServletRequest servletRequest = new SOAPProcessorHttpServletRequest(path, soapMessage, headers) ;
            final SOAPProcessorHttpServletResponse servletResponse = new SOAPProcessorHttpServletResponse() ;
            final ServletContext servletContext = SOAPProcessorFactory.getFactory().createServletContext(endpoint) ;

            EndpointAssociation.setEndpoint(endpoint);
            final ClassLoader old = Thread.currentThread().getContextClassLoader();
            try
            {
                initialiseContextClassLoader(endpoint);
                requestHandler.handleHttpRequest(endpoint, servletRequest, servletResponse, servletContext) ;
            }
            finally
            {
                Thread.currentThread().setContextClassLoader(old);
                EndpointAssociation.removeEndpoint();
View Full Code Here


         if(!started) startEndpoint();

         try
         {
            EndpointAssociation.setEndpoint(endpoint);
            RequestHandler requestHandler = endpoint.getRequestHandler();
            requestHandler.handleHttpRequest(endpoint, req, res, getServletContext());
         }
         finally
         {
            EndpointAssociation.removeEndpoint();
         }
View Full Code Here

      }

      try
      {
         EndpointAssociation.setEndpoint(endpoint);
         RequestHandler requestHandler = endpoint.getRequestHandler();
         requestHandler.handleHttpRequest(endpoint, req, res, getServletContext());
      }
      finally
      {
         EndpointAssociation.removeEndpoint();
      }
View Full Code Here

            {
               throw new EJBException(e);
            }
         }

         RequestHandler reqHandler = endpoint.getRequestHandler();

         try
         {
            InvocationContext invContext = new InvocationContext();
            invContext.setTargetBean(this);

            reqHandler.handleRequest(endpoint, inputStream, outStream, invContext);
         }
         catch (Exception ex)
         {
            throw new RemoteException("Cannot process SOAP request", ex);
         }
View Full Code Here

      if (endpoint == null)
         throw new IllegalStateException("Cannot find endpoint for: " + fromName);

      log.debug("dipatchMessage: " + endpoint.getName());

      RequestHandler reqHandler = endpoint.getRequestHandler();

      try
      {
         InvocationContext invContext = new InvocationContext();
         invContext.setTargetBean(this);

         reqHandler.handleRequest(endpoint, inputStream, outStream, invContext);
      }
      catch (Exception ex)
      {
         throw new RemoteException("Cannot process SOAP request", ex);
      }
View Full Code Here

            {
               throw new EJBException(e);
            }
         }

         RequestHandler reqHandler = endpoint.getRequestHandler();

         try
         {
            InvocationContext invContext = new InvocationContext();
            invContext.setTargetBean(this);

            reqHandler.handleRequest(endpoint, inputStream, outStream, invContext);
         }
         catch (Exception ex)
         {
            throw new RemoteException("Cannot process SOAP request", ex);
         }
View Full Code Here

      SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
      EndpointRegistry registry = spiProvider.getSPI(EndpointRegistryFactory.class).getEndpointRegistry();
     
      ObjectName oname = ObjectNameFactory.create("jboss.ws:context=jaxws-jbws1909,endpoint=TestEndpointImpl");
      Endpoint endpoint = registry.getEndpoint(oname);
      RequestHandler reqHandler = endpoint.getRequestHandler();
     
      try
      {
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         reqHandler.handleWSDLRequest(endpoint, baos, null); // The context is null
        
         ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
         Element root = DOMUtils.parse(bais);
         Element serviceEl = DOMUtils.getFirstChildElement(root, new QName("http://schemas.xmlsoap.org/wsdl/", "service"));
         String serviceName = DOMUtils.getAttributeValue(serviceEl, "name");
View Full Code Here

      }

      try
      {
         EndpointAssociation.setEndpoint(endpoint);
         RequestHandler requestHandler = endpoint.getRequestHandler();
         requestHandler.handleHttpRequest(endpoint, req, res, getServletContext());
      }
      finally
      {
         EndpointAssociation.removeEndpoint();
      }
View Full Code Here

            {
               throw new EJBException(e);
            }
         }

         RequestHandler reqHandler = endpoint.getRequestHandler();

         try
         {
            InvocationContext invContext = new InvocationContext();
            invContext.setTargetBean(this);

            reqHandler.handleRequest(endpoint, inputStream, outStream, invContext);
         }
         catch (Exception ex)
         {
            throw new RemoteException("Cannot process SOAP request", ex);
         }
View Full Code Here

/*     */     }
/*     */
/*     */     try
/*     */     {
/*  82 */       EndpointAssociation.setEndpoint(this.endpoint);
/*  83 */       RequestHandler requestHandler = this.endpoint.getRequestHandler();
/*  84 */       requestHandler.handleHttpRequest(this.endpoint, req, res, getServletContext());
/*     */     }
/*     */     finally
/*     */     {
/*  88 */       EndpointAssociation.removeEndpoint();
/*     */     }
View Full Code Here

TOP

Related Classes of org.jboss.wsf.spi.invocation.RequestHandler

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.