Package org.apache.axis2.description

Examples of org.apache.axis2.description.AxisMessage


        String methodName = null;
        try {
            AxisOperation op = inMessage.getOperationContext().getAxisOperation();
            AxisService service = inMessage.getAxisService();
            OMElement methodElement = inMessage.getEnvelope().getBody().getFirstElement();
            AxisMessage inAxisMessage = op.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
            String messageNameSpace = null;
            QName elementQName;
            methodName = op.getName().getLocalPart();

            Invoker invoker = (Invoker) invokerCache.get(methodName);
            if (invoker==null) {
                if (orb==null) {
                    Parameter orbParam = service.getParameter(ORB_LITERAL);
                    orb = orbParam != null ? (ORB) orbParam.getValue() : CorbaUtil.getORB(service);
                }
                org.omg.CORBA.Object obj = CorbaUtil.resolveObject(service, orb);
                Parameter idlParameter = service.getParameter(IDL_LITERAL);
                if (idlParameter==null)
                    throw new CorbaInvocationException("IDL not found");
                IDL idl = (IDL) idlParameter.getValue();
                invoker = CorbaUtil.getInvoker(service, obj, idl, methodName);
                invokerCache.put(methodName, invoker);
            }

            Object resObject = null;
            Member[] params = null;
            Object[] outParamValues = null;
            if (inAxisMessage != null) {
                if (inAxisMessage.getElementQName() != null) {
                    elementQName = inAxisMessage.getElementQName();
                    messageNameSpace = elementQName.getNamespaceURI();
                    OMNamespace namespace = methodElement.getNamespace();
                    if (messageNameSpace != null) {
                        if (namespace == null) {
                            throw new AxisFault("namespace mismatch require " +
                                    messageNameSpace +
                                    " found none");
                        }
                        if (!messageNameSpace.equals(namespace.getNamespaceURI())) {
                            throw new AxisFault("namespace mismatch require " +
                                    messageNameSpace +
                                    " found " + methodElement.getNamespace().getNamespaceURI());
                        }
                    } else if (namespace != null) {
                        throw new AxisFault("namespace mismatch. Axis Oepration expects non-namespace " +
                                "qualified element. But received a namespace qualified element");
                    }
                    Object[] objectArray = CorbaUtil.extractParameters(methodElement, invoker.getParameterMembers());
                    invoker.setParameters(objectArray);
                }
                resObject = invoker.invoke();
                params = invoker.getParameterMembers();
                outParamValues = invoker.getOutParameterValuess();
            }

            if (messageNameSpace == null) {
                AxisMessage outaxisMessage = op.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
                QName qname = outaxisMessage.getElementQName();
                if (qname != null) {
                    messageNameSpace = qname.getNamespaceURI();
                }
            }
View Full Code Here


    AxisOperation axisOperation = axisBindingOperation.getAxisOperation();

    if (WSDLUtil.isInputPresentForMEP(axisOperation
        .getMessageExchangePattern())) {
      AxisMessage axisInMessage = axisOperation
          .getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
      AxisBindingMessage axisBindingInMessage = new AxisBindingMessage();

      axisBindingInMessage.setName(axisInMessage.getName());
      axisBindingInMessage.setDirection(axisInMessage.getDirection());
      axisBindingInMessage.setAxisMessage(axisInMessage);

      axisBindingInMessage.setParent(axisBindingOperation);
      axisBindingOperation.addChild(WSDLConstants.MESSAGE_LABEL_IN_VALUE,
          axisBindingInMessage);
    }

    if (WSDLUtil.isOutputPresentForMEP(axisOperation
        .getMessageExchangePattern())) {
      AxisMessage axisOutMessage = axisOperation
          .getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
      AxisBindingMessage axisBindingOutMessage = new AxisBindingMessage();

      axisBindingOutMessage.setName(axisOutMessage.getName());
      axisBindingOutMessage.setDirection(axisOutMessage.getDirection());
      axisBindingOutMessage.setAxisMessage(axisOutMessage);

      axisBindingOutMessage.setParent(axisBindingOperation);
      axisBindingOperation.addChild(
          WSDLConstants.MESSAGE_LABEL_OUT_VALUE,
          axisBindingOutMessage);
    }

    ArrayList faultMessagesList = axisOperation.getFaultMessages();
    for (Iterator iterator2 = faultMessagesList.iterator(); iterator2
        .hasNext();) {
      AxisMessage axisFaultMessage = (AxisMessage) iterator2.next();
      AxisBindingMessage axisBindingFaultMessage = new AxisBindingMessage();
            axisBindingFaultMessage.setName(axisFaultMessage.getName());
            axisBindingFaultMessage.setFault(true);
      axisBindingFaultMessage.setAxisMessage(axisFaultMessage);
      axisBindingFaultMessage.setParent(axisBindingOperation);
      axisBindingOperation.addFault(axisBindingFaultMessage);
            axisBinding.addFault(axisBindingFaultMessage);
View Full Code Here

                        for (Iterator operations = axisService.getOperations();
                             operations.hasNext();) {
                            AxisOperation op = (AxisOperation)operations.next();

                            if (WSDLUtil.isInputPresentForMEP(op.getMessageExchangePattern())) {
                                AxisMessage message = op.getMessage(
                                        WSDLConstants.MESSAGE_LABEL_IN_VALUE);
                                if (message != null &&
                                        message.getParameter(Constants.UNWRAPPED_KEY) != null) {

                                    Mapping mapping = jaxbModel.get(message.getElementQName());
                                    List elementProperties = mapping.getWrapperStyleDrilldown();
                                    for(int j = 0; j < elementProperties.size(); j++){
                                        Property elementProperty = (Property) elementProperties.get(j);

                                        QName partQName =
                                                    WSDLUtil.getPartQName(op.getName().getLocalPart(),
                                                                          WSDLConstants.INPUT_PART_QNAME_SUFFIX,
                                                                          elementProperty.elementName().getLocalPart());
                                        //this type is based on a primitive type- use the
                                        //primitive type name in this case
                                        String fullJaveName =
                                                elementProperty.type().fullName();
                                        if (elementProperty.type().isArray()) {
                                            fullJaveName = fullJaveName.concat("[]");
                                        }
                                        mapper.addTypeMappingName(partQName, fullJaveName);

                                        if (elementProperty.type().isPrimitive()) {
                                            mapper.addTypeMappingStatus(partQName, Boolean.TRUE);
                                        }
                                        if (elementProperty.type().isArray()) {
                                            mapper.addTypeMappingStatus(partQName,
                                                                        Constants.ARRAY_TYPE);
                                        }
                                    }
                                }
                            }

                            if (WSDLUtil.isOutputPresentForMEP(op.getMessageExchangePattern())) {
                                AxisMessage message = op.getMessage(
                                        WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
                                if (message != null &&
                                        message.getParameter(Constants.UNWRAPPED_KEY) != null) {

                                    Mapping mapping = jaxbModel.get(message.getElementQName());
                                    List elementProperties = mapping.getWrapperStyleDrilldown();
                                    for(int j = 0; j < elementProperties.size(); j++){
                                        Property elementProperty = (Property) elementProperties.get(j);

                                        QName partQName =
View Full Code Here

                method = null;
            }
            AxisService service = inMessage.getAxisService();
            OMElement methodElement = inMessage.getEnvelope().getBody()
                    .getFirstElement();
            AxisMessage inAxisMessage = op.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
            String messageNameSpace = null;


            if (method == null) {
                String methodName = op.getName().getLocalPart();
                Method[] methods = implClass.getMethods();

                for (Method method1 : methods) {
                    if (method1.isBridge()) {
                        continue;
                    }
                    if (method1.getName().equals(methodName)) {
                        method = method1;
                        op.addParameter("myMethod", method);
                        break;
                    }
                }
                if (method == null) {
                    throw new AxisFault("No such method '" + methodName +
                            "' in class " + implClass.getName());
                }
            }
            Object resObject = null;
            if (inAxisMessage != null) {
                resObject = RPCUtil.invokeServiceClass(inAxisMessage,
                        method,
                        obj,
                        messageNameSpace,
                        methodElement,inMessage);
            }


            SOAPFactory fac = getSOAPFactory(inMessage);

            // Handling the response
            AxisMessage outaxisMessage = op.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
            if (outaxisMessage != null && outaxisMessage.getElementQName() !=null) {
                messageNameSpace = outaxisMessage.getElementQName().getNamespaceURI();
            } else {
                messageNameSpace = service.getTargetNamespace();
            }

            OMNamespace ns = fac.createOMNamespace(messageNameSpace,
View Full Code Here

                    if (!paramDesc.isHeader()
                            && (paramMode == WebParam.Mode.IN || paramMode == WebParam.Mode.INOUT))
                    {
                        // We've found the first IN or INOUT non-header parameter, so set the AxisMessage
                        // QName based on this parameter then break out of the loop.
                        AxisMessage axisMessage =
                                newAxisOperation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
                        String elementName = paramDesc.getParameterName();
                        String partNamespace = paramDesc.getTargetNamespace();
                        if (log.isDebugEnabled()) {
                            log.debug("Setting up annotation based Doc/Lit/Bare operation: " +
                                    newAxisOperation.getName()
                                    + "; axisMessage: " + axisMessage + "; name: "
                                    + elementName + "; partTNS: " + partNamespace);
                        }
                        if (axisMessage == null) {
                            throw ExceptionFactory.makeWebServiceException(Messages.getMessage("createAxisOprErr1"));
                        } else if (DescriptionUtils.isEmpty(partNamespace)) {
                            throw ExceptionFactory.makeWebServiceException(Messages.getMessage("createAxisOprErr2"));
                        } else if (DescriptionUtils.isEmpty(elementName)) {
                            throw ExceptionFactory.makeWebServiceException(Messages.getMessage("createAxisOprErr3"));
                        } else {
                            QName partQName = new QName(partNamespace, elementName);
                            if(log.isDebugEnabled()) {
                                log.debug("Setting AxisMessage element QName for bare mapping: " +
                                        partQName);
                            }
                            axisMessage.setElementQName(partQName);
                           
                            getEndpointInterfaceDescriptionImpl().getEndpointDescriptionImpl()
                            .getAxisService()
                              .addMessageElementQNameToOperationMapping(partQName, newAxisOperation);
                        }
View Full Code Here

       
        //Generate fault actions according to the Default Action Pattern.
        if (faultDescs != null) {
            for (FaultDescription faultDesc : faultDescs) {
       
                AxisMessage faultMessage = new AxisMessage();
                String faultName = faultDesc.getName();
               
                if (faultName == null || faultName.equals("")) {
                    faultName = faultDesc.getExceptionClassName();
                    // Remove package name to get just class name
                    faultName = faultName.substring((faultName.lastIndexOf('.'))+1);
                }
               
                faultMessage.setName(faultName);
                if (log.isDebugEnabled()) {
                    log.debug("Set faultName = "+faultName+" for faultMessage = "+faultMessage+" and faultDesc = "+faultDesc);
                }
               
                String faultAction =
                        WSDL11ActionHelper.getFaultActionFromStringInformation( targetNS,
                                        portTypeName,
                                        operationName,
                                        faultMessage.getName());

                if (log.isDebugEnabled()) {
                    log.debug("Default faultAction = "+faultAction);
                }
               
View Full Code Here

        }
        if (getSoapBindingStyle() == javax.jws.soap.SOAPBinding.Style.DOCUMENT
                && getSoapBindingUse() == javax.jws.soap.SOAPBinding.Use.LITERAL
                && getSoapBindingParameterStyle() == javax.jws.soap.SOAPBinding.ParameterStyle
                .BARE) {
            AxisMessage axisMessage =
                    null;
            if (existingAxisOperation!=null) {
                axisMessage = existingAxisOperation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
            } else {
                axisMessage = newAxisOperation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
            }
            if (axisMessage != null) {
                QName elementQName = axisMessage.getElementQName();
                if (!DescriptionUtils.isEmpty(elementQName) &&
                    axisService.getOperationByMessageElementQName(elementQName) == null) {
                    axisService.addMessageElementQNameToOperationMapping(elementQName,
                            newAxisOperation);
                }
View Full Code Here

        try {
            DynamicAxisOperation dynamicOperation =
                new DynamicAxisOperation(new QName(DYNAMIC_OPERATION));
            dynamicOperation.setMessageReceiver(synapseCallback);
            AxisMessage inMsg = new AxisMessage();
            inMsg.setName("in-message");
            inMsg.setParent(dynamicOperation);
            AxisMessage outMsg = new AxisMessage();
            outMsg.setName("out-message");
            outMsg.setParent(dynamicOperation);
            dynamicOperation.addMessage(inMsg, WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
            dynamicOperation.addMessage(outMsg, WSDLConstants.MESSAGE_LABEL_IN_VALUE);
            AxisService axisAnonymousService  = new AxisService(serviceKey);
            axisAnonymousService.addOperation(dynamicOperation);
            axisCfg.addService(axisAnonymousService);
View Full Code Here

        assertNotNull(er);
        AxisService service = er.getService("MessagetestService");
        assertNotNull(service);
        AxisOperation op = service.getOperation(new QName("echoString"));
        assertNotNull(op);
        AxisMessage message = op.getMessage("In");
        assertNotNull(message);
        Parameter para = message.getParameter("messageIN");
        assertNotNull(para);
        assertEquals(para.getValue(), "messageIN");


        op = service.getOperation(new QName("echoStringArray"));
        assertNotNull(op);
        message = op.getMessage("In");
        assertNotNull(message);
        para = message.getParameter("messageIN");
        assertNotNull(para);
        assertEquals(para.getValue(), "messageIN");

        message = op.getMessage("Out");
        assertNotNull(message);
        para = message.getParameter("messageOut");
        assertNotNull(para);
        assertEquals(para.getValue(), "messageOut");

    }
View Full Code Here

    addPolicyAsExtElements(description, policyList, wsdlOperation,
        policyInclude);

    if (WSDLConstants.MEP_URI_IN_ONLY.equals(axisOperation
        .getMessageExchangePattern())) {
      AxisMessage input = axisOperation
          .getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
      PolicyInclude policyInclude2 = input.getPolicyInclude();

      // wsdl:PortType -> wsdl:Operation -> wsdl:Input
      List policyList2 = policyInclude2
          .getPolicyElements(PolicyInclude.INPUT_POLICY);
      addPolicyAsExtAttributes(description, policyList2, wsdlOperation
          .getInputMessage(), policyInclude2);

    } else if (WSDLConstants.MEP_URI_IN_OUT.equals(axisOperation
        .getMessageExchangePattern())) {
      PolicyInclude policyInclude2;
      List policyList2;

      AxisMessage input = axisOperation
          .getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
      policyInclude2 = input.getPolicyInclude();

      // wsdl:PortType -> wsdl:Operation -> wsdl:Input
      policyList2 = policyInclude2
          .getPolicyElements(PolicyInclude.INPUT_POLICY);
      addPolicyAsExtAttributes(description, policyList2, wsdlOperation
          .getInputMessage(), policyInclude2);

      AxisMessage output = axisOperation
          .getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
      policyInclude2 = output.getPolicyInclude();

      // wsdl:PortType -> wsdl:Operation -> wsdl:Output
      policyList2 = policyInclude2
          .getPolicyElements(PolicyInclude.OUTPUT_POLICY);
      addPolicyAsExtAttributes(description, policyList2, wsdlOperation
View Full Code Here

TOP

Related Classes of org.apache.axis2.description.AxisMessage

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.