Examples of EndpointInvocation


Examples of org.jboss.ws.core.EndpointInvocation

      paramMetaData.setMode(ParameterMode.OUT);
      paramMetaData.setInHeader(true);
      paramMetaData.setIndex(1);
      opMetaData.addParameter(paramMetaData);

      EndpointInvocation epInv = new EndpointInvocation(opMetaData);
      binding.unbindResponseMessage(opMetaData, resMessage, epInv, null);
      assertEquals("Hello World!", epInv.getReturnValue());

      Object headerValue = epInv.getResponseParamValue(xmlName);
      assertEquals("OUT header message", headerValue);
   }
View Full Code Here

Examples of org.jboss.ws.core.EndpointInvocation

      UnboundHeader header = new UnboundHeader(xmlName, Constants.TYPE_LITERAL_STRING, String.class, ParameterMode.OUT);

      Map headers = new HashMap();
      headers.put(xmlName, header);

      EndpointInvocation epInv = new EndpointInvocation(opMetaData);
      binding.unbindResponseMessage(opMetaData, resMessage, epInv, headers);
      assertEquals("Hello World!", epInv.getReturnValue());

      assertEquals("OUT header message", header.getHeaderValue());
   }
View Full Code Here

Examples of org.jboss.ws.core.EndpointInvocation

      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
      msgContext.setSOAPMessage(resMessage);

      try
      {
         EndpointInvocation epInv = new EndpointInvocation(opMetaData);
         binding.unbindResponseMessage(opMetaData, resMessage, epInv, null);
         fail("SOAPFaultException expected");
      }
      catch (SOAPFaultException faultEx)
      {
View Full Code Here

Examples of org.jboss.ws.core.EndpointInvocation

   {
      log.debug("unbindRequestMessage: " + opMetaData.getQName());
      try
      {
         // Construct the endpoint invocation object
         EndpointInvocation epInv = new EndpointInvocation(opMetaData);

         CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
         if (msgContext == null)
            throw new WSException("MessageContext not available");

         ParameterMetaData paramMetaData = opMetaData.getParameters().get(0);
         QName xmlName = paramMetaData.getXmlName();

         HTTPMessageImpl httpMessage = (HTTPMessageImpl)reqMessage;
         Source source = httpMessage.getXmlFragment().getSource();

         epInv.setRequestParamValue(xmlName, source);

         return epInv;
      }
      catch (Exception e)
      {
View Full Code Here

Examples of org.jboss.ws.core.EndpointInvocation

      setInboundContextProperties();

      try
      {
         boolean oneway = false;
         EndpointInvocation sepInv = null;
         OperationMetaData opMetaData = null;
         CommonBinding binding = bindingProvider.getCommonBinding();
         binding.setHeaderSource(delegate);

         if (binding instanceof CommonSOAPBinding)
            XOPContext.setMTOMEnabled(((CommonSOAPBinding)binding).isMTOMEnabled());
        
         // call the request handler chain
         boolean handlersPass = callRequestHandlerChain(sepMetaData, handlerType[0]);

         // Unbind the request message
         if (handlersPass)
         {
            // Get the operation meta data from the SOAP message
            opMetaData = getDispatchDestination(sepMetaData, reqMessage);
            msgContext.setOperationMetaData(opMetaData);
            oneway = opMetaData.isOneWay();

            /*
             * From JAX-WS 10.2.1 - "7. If the node does not understand how to process
             * the message, then neither handlers nor the endpoint
             * are invoked and instead the binding generates a SOAP must
             * understand exception"
             *
             * Therefore, this must precede the ENDPOINT chain; however, The PRE
             * chain still must happen first since the message may be encrypted, in which
             * case the operation is still not known. Without knowing the operation, it
             * is not possible to determine what headers are understood by the endpoint.
             */
            if (binding instanceof CommonSOAPBinding)
               ((CommonSOAPBinding)binding).checkMustUnderstand(opMetaData);

            // Unbind the request message
            sepInv = binding.unbindRequestMessage(opMetaData, reqMessage);
         }

         handlersPass = handlersPass && callRequestHandlerChain(sepMetaData, handlerType[1]);
         handlersPass = handlersPass && callRequestHandlerChain(sepMetaData, handlerType[2]);

         if (handlersPass)
         {
            msgContext.put(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
            try
            {
               // Check if protocol handlers modified the payload
               if (msgContext.isModified())
               {
                  log.debug("Handler modified payload, unbind message again");
                  reqMessage = msgContext.getMessageAbstraction();
                  sepInv = binding.unbindRequestMessage(opMetaData, reqMessage);
               }
               //JBWS-2969:check if the RPC/Lit input paramter is null
               if (opMetaData.getEndpointMetaData().getType() != EndpointMetaData.Type.JAXRPC
                     && opMetaData.isRPCLiteral() && sepInv.getRequestParamNames() != null)
               { 
                 
                  for (QName qname : sepInv.getRequestParamNames())
                  {
                     ParameterMetaData paramMetaData = opMetaData.getParameter(qname);
                     if ((paramMetaData.getMode().equals(ParameterMode.IN) || paramMetaData.getMode().equals(ParameterMode.INOUT)) && sepInv.getRequestParamValue(qname) == null)
                     {
                        throw new WebServiceException("The RPC/Literal Operation [" + opMetaData.getQName()
                              + "] parameters can not be null");
                     }
                  }
View Full Code Here

Examples of org.jboss.ws.core.EndpointInvocation

   {
      log.debug("unbindRequestMessage: " + opMetaData.getQName());
      try
      {
         // Construct the endpoint invocation object
         EndpointInvocation epInv = new EndpointInvocation(opMetaData);

         SOAPMessageContextJAXWS msgContext = (SOAPMessageContextJAXWS)MessageContextAssociation.peekMessageContext();
         if (msgContext == null)
            throw new WSException("MessageContext not available");

         ParameterMetaData paramMetaData = opMetaData.getParameters().get(0);
         QName xmlName = paramMetaData.getXmlName();
         epInv.setRequestParamValue(xmlName, reqMessage);

         return epInv;
      }
      catch (Exception e)
      {
View Full Code Here

Examples of org.jboss.ws.core.EndpointInvocation

   {
      log.debug("unbindRequestMessage: " + opMetaData.getQName());
      try
      {
         // Construct the endpoint invocation object
         EndpointInvocation epInv = new EndpointInvocation(opMetaData);

         CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
         if (msgContext == null)
            throw new WSException("MessageContext not available");

         ParameterMetaData paramMetaData = opMetaData.getParameters().get(0);
         QName xmlName = paramMetaData.getXmlName();

         HTTPMessageImpl httpMessage = (HTTPMessageImpl)reqMessage;
         Source source = httpMessage.getXmlFragment().getSource();

         epInv.setRequestParamValue(xmlName, source);

         return epInv;
      }
      catch (Exception e)
      {
View Full Code Here

Examples of org.jboss.ws.core.EndpointInvocation

   {
      log.debug("unbindRequestMessage: " + opMetaData.getQName());
      try
      {
         // Construct the endpoint invocation object
         EndpointInvocation epInv = new EndpointInvocation(opMetaData);

         CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
         if (msgContext == null)
            throw new WSException("MessageContext not available");

         ParameterMetaData paramMetaData = opMetaData.getParameters().get(0);
         QName xmlName = paramMetaData.getXmlName();

         SOAPMessage reqMessage = (SOAPMessage)payload;
         SOAPBodyImpl body = (SOAPBodyImpl)reqMessage.getSOAPBody();
        
         SOAPContentElement bodyElement = (SOAPContentElement)body.getBodyElement();
         Source source = bodyElement.getXMLFragment().getSource();
         if (source == null)
            throw new IllegalStateException("Payload cannot be null");

         epInv.setRequestParamValue(xmlName, source);

         return epInv;
      }
      catch (Exception e)
      {
View Full Code Here

Examples of org.jboss.ws.core.EndpointInvocation

      setInboundContextProperties();

      try
      {
         boolean oneway = false;
         EndpointInvocation sepInv = null;
         OperationMetaData opMetaData = null;
         CommonBinding binding = bindingProvider.getCommonBinding();
         binding.setHeaderSource(delegate);

         // call the request handler chain
View Full Code Here

Examples of org.jboss.ws.core.EndpointInvocation

      setInboundContextProperties();

      try
      {
         boolean oneway = false;
         EndpointInvocation sepInv = null;
         OperationMetaData opMetaData = null;
         CommonBinding binding = bindingProvider.getCommonBinding();
         binding.setHeaderSource(delegate);

         if (binding instanceof CommonSOAPBinding)
            XOPContext.setMTOMEnabled(((CommonSOAPBinding)binding).isMTOMEnabled());
        
         // call the request handler chain
         boolean handlersPass = callRequestHandlerChain(sepMetaData, handlerType[0]);

         // Unbind the request message
         if (handlersPass)
         {
            // Get the operation meta data from the SOAP message
            opMetaData = getDispatchDestination(sepMetaData, reqMessage);
            msgContext.setOperationMetaData(opMetaData);
            oneway = opMetaData.isOneWay();

            /*
             * From JAX-WS 10.2.1 - "7. If the node does not understand how to process
             * the message, then neither handlers nor the endpoint
             * are invoked and instead the binding generates a SOAP must
             * understand exception"
             *
             * Therefore, this must precede the ENDPOINT chain; however, The PRE
             * chain still must happen first since the message may be encrypted, in which
             * case the operation is still not known. Without knowing the operation, it
             * is not possible to determine what headers are understood by the endpoint.
             */
            if (binding instanceof CommonSOAPBinding)
               ((CommonSOAPBinding)binding).checkMustUnderstand(opMetaData);

            // Unbind the request message
            sepInv = binding.unbindRequestMessage(opMetaData, reqMessage);
         }

         handlersPass = handlersPass && callRequestHandlerChain(sepMetaData, handlerType[1]);
         handlersPass = handlersPass && callRequestHandlerChain(sepMetaData, handlerType[2]);

         if (handlersPass)
         {
            msgContext.put(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
            try
            {
               // Check if protocol handlers modified the payload
               if (msgContext.isModified())
               {
                  log.debug("Handler modified payload, unbind message again");
                  reqMessage = msgContext.getMessageAbstraction();
                  sepInv = binding.unbindRequestMessage(opMetaData, reqMessage);
               }
               //JBWS-2969:check if the RPC/Lit input paramter is null
               if (opMetaData.getEndpointMetaData().getType() != EndpointMetaData.Type.JAXRPC
                     && opMetaData.isRPCLiteral() && sepInv.getRequestParamNames() != null)
               { 
                 
                  for (QName qname : sepInv.getRequestParamNames())
                  {
                     ParameterMetaData paramMetaData = opMetaData.getParameter(qname);
                     if ((paramMetaData.getMode().equals(ParameterMode.IN) || paramMetaData.getMode().equals(ParameterMode.INOUT)) && sepInv.getRequestParamValue(qname) == null)
                     {
                        throw new WebServiceException("The RPC/Literal Operation [" + opMetaData.getQName()
                              + "] parameters can not be null");
                     }
                  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.