Package org.jboss.ws.metadata.umdm

Examples of org.jboss.ws.metadata.umdm.OperationMetaData


    * @throws IllegalArgumentException If invalid operation name is specified
    */
   public boolean isParameterAndReturnSpecRequired(QName opName)
   {
      setOperationName(opName);
      OperationMetaData opMetaData = getOperationMetaData();
      return opMetaData.getParameters().size() == 0 && opMetaData.getReturnParameter() == null;
   }
View Full Code Here


   /** Gets the XML type of a parameter by name.
    */
   public QName getParameterTypeByName(String paramName)
   {
      OperationMetaData opMetaData = getOperationMetaData();
      ParameterMetaData paramMetaData = opMetaData.getParameter(new QName(paramName));
      if (paramMetaData != null)
         return paramMetaData.getXmlType();
      else return null;
   }
View Full Code Here

   private Object invokeInternal(QName opName, Object[] inputParams, boolean forceOneway) throws RemoteException
   {
      if (opName.equals(operationName) == false)
         setOperationName(opName);

      OperationMetaData opMetaData = getOperationMetaData();

      // Check or generate the the schema if this call is unconfigured
      generateOrUpdateSchemas(opMetaData);

      // Associate a message context with the current thread
View Full Code Here

   /** Get the operation meta data for a given SOAP message
    */
   public OperationMetaData getDispatchDestination(EndpointMetaData epMetaData, SOAPMessage soapMessage) throws SOAPException
   {
      OperationMetaData opMetaData = null;

      // Dispatch based on wsa:Action
      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
      AddressingProperties inProps = (AddressingProperties)msgContext.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
      if (inProps != null && inProps.getAction() != null)
      {
         String wsaAction = inProps.getAction().getURI().toASCIIString();
         for (OperationMetaData opAux : epMetaData.getOperations())
         {
            if (wsaAction.equals(opAux.getSOAPAction()))
            {
               opMetaData = opAux;
               log.debug("Use wsa:Action dispatch: " + wsaAction);
               break;
            }
         }
      }

      // Dispatch to JAXWS Provider
      if (opMetaData == null && epMetaData.getServiceMode() != null)
      {
         QName xmlName = new QName(epMetaData.getPortName().getNamespaceURI(), "invoke");
         opMetaData = epMetaData.getOperation(xmlName);
      }

      // Dispatch based on SOAPBodyElement name
      if (opMetaData == null)
      {
         SOAPBody soapBody = soapMessage.getSOAPBody();

         SOAPBodyElement soapBodyElement = null;
         Iterator bodyChildren = soapBody.getChildElements();
         while (bodyChildren.hasNext() && soapBodyElement == null)
         {
            Object childNode = bodyChildren.next();
            if (childNode instanceof SOAPBodyElement)
            {
               soapBodyElement = (SOAPBodyElement)childNode;
            }
         }

         if (soapBodyElement == null)
         {
            if (epMetaData.getStyle() == Style.RPC)
               throw new SOAPException("Empty SOAP body with no child element not supported for RPC");

            // [JBWS-1125] Support empty soap body elements
            for (OperationMetaData opAux : epMetaData.getOperations())
            {
               if (opAux.getParameters().size() == 0)
               {
                  log.debug ("Dispatching empty SOAP body");
                  opMetaData = opAux;
                  break;
               }
            }
         }
         else
         {
            Name soapName = soapBodyElement.getElementName();
            QName xmlElementName = new QName(soapName.getURI(), soapName.getLocalName());
            opMetaData = epMetaData.getOperation(xmlElementName);
         }
      }

      // Dispatch to a generic operation that takes an org.w3c.dom.Element
      if (opMetaData == null)
      {
         for (OperationMetaData opAux : epMetaData.getOperations())
         {
            if (opAux.isMessageEndpoint())
            {
               log.debug("Use generic message style dispatch");
               opMetaData = opAux;
               break;
            }
         }
      }

      log.debug("getDispatchDestination: " + (opMetaData != null ? opMetaData.getQName() : null));
      return opMetaData;
   }
View Full Code Here

      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
View Full Code Here

      return msgContext;
   }

   private OperationMetaData getDispatchDestination(EndpointMetaData epMetaData, MessageAbstraction reqMessage) throws SOAPException
   {
      OperationMetaData opMetaData;

      String bindingID = epMetaData.getBindingId();
      if (HTTPBinding.HTTP_BINDING.equals(bindingID))
      {
         if (epMetaData.getOperations().size() != 1)
View Full Code Here

      // If matching by name fails, try to match by xmlType
      // This maybe necessary when wsa:Action dispatches to the operation
      if (soapContentElement == null)
      {
         childElements = soapElement.getChildElements();
         OperationMetaData opMetaData = paramMetaData.getOperationMetaData();
         TypesMetaData typesMetaData = opMetaData.getEndpointMetaData().getServiceMetaData().getTypesMetaData();
         if (childElements.hasNext() && opMetaData.getStyle() == Style.DOCUMENT)
         {
            SOAPElementImpl childElement = (SOAPElementImpl)childElements.next();

            // The parameters are expected to be lazy
            SOAPContentElement aux = (SOAPContentElement)childElement;
View Full Code Here

      try
      {
         // supply the response action

         OperationMetaData opMetaData = ((SOAPMessageContextJAXRPC)msgContext).getOperationMetaData();

         if (!isFault && !opMetaData.isOneWay())
         {

            AddressingOpMetaExt addrExt = (AddressingOpMetaExt)opMetaData.getExtension(ADDR_CONSTANTS.getNamespaceURI());
            if (addrExt != null)
            {
               outProps.setAction(ADDR_BUILDER.newURI(addrExt.getOutboundAction()));
            }
            else
            {
               log.warn("Unable to resolve replyAction for " + opMetaData.getQName());
            }

         }
         else if (isFault)
         {
View Full Code Here

    try
    {
      // supply the response action

      OperationMetaData opMetaData = ((CommonMessageContext)msgContext).getOperationMetaData();

      if (!isFault && !opMetaData.isOneWay())
      {

        AddressingOpMetaExt addrExt = (AddressingOpMetaExt)opMetaData.getExtension(ADDR_CONSTANTS.getNamespaceURI());
        if (addrExt != null)
        {
          outProps.setAction(ADDR_BUILDER.newURI(addrExt.getOutboundAction()));
        }
        else
        {
          log.warn("Unable to resolve replyAction for " + opMetaData.getQName());
        }

      }
      else if (isFault)
      {
View Full Code Here

         {
            DetailEntry deElement = (DetailEntry)it.next();
            QName xmlName = deElement.getElementQName();
            log.debug("Processing detail entry: " + xmlName);

            OperationMetaData opMetaData = msgContext.getOperationMetaData();
            FaultMetaData faultMetaData = opMetaData.getFault(xmlName);
            if (faultMetaData != null)
            {
               log.debug("Deserialize fault: " + faultMetaData);
               QName xmlType = faultMetaData.getXmlType();
               Class<?> faultBeanClass = faultMetaData.getFaultBean();

               // Get the deserializer from the type mapping
               AbstractDeserializerFactory desFactory = (AbstractDeserializerFactory)typeMapping.getDeserializer(faultBeanClass, xmlType);
               if (desFactory == null)
                  throw new WebServiceException("Cannot obtain deserializer factory: xmlType=" + xmlType + ", javaType=" + faultBeanClass);

               // http://jira.jboss.org/jira/browse/JBWS-955
               // Cannot deserialize fault detail
               String prefix = deElement.getPrefix();
               if (prefix != null && prefix.length() > 0)
               {
                  String nsURI = deElement.getNamespaceURI();
                  if (nsURI.length() > 0 && deElement.getAttributeNS(Constants.NS_XMLNS, prefix).length() == 0)
                  {
                     try
                     {
                        deElement.addNamespaceDeclaration(prefix, nsURI);
                     }
                     catch (SOAPException e)
                     {
                        log.warn("Declaration of detail entry namespace failed", e);
                     }
                  }
               }

               // Try jaxb deserialization
               try
               {
                  Class[] types = opMetaData.getEndpointMetaData().getRegisteredTypes().toArray(new Class[0]);
                  serContext.setProperty(SerializationContextJAXWS.JAXB_CONTEXT_TYPES, types);

                  Source source = new DOMSource(deElement);
                  DeserializerSupport des = (DeserializerSupport)desFactory.getDeserializer();
                  Object faultBean = des.deserialize(xmlName, xmlType, source, serContext);
View Full Code Here

TOP

Related Classes of org.jboss.ws.metadata.umdm.OperationMetaData

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.