Package org.apache.axis2.description

Examples of org.apache.axis2.description.AxisMessage


                continue;
            String opName = jmethod.getSimpleName();
            AxisOperation operation = axisService.getOperation(new QName(opName));
            // if the opeartion there in services.xml then try to set it schema element name
            if (operation != null) {
                AxisMessage inMessage = operation.getMessage(
                        WSDLConstants.MESSAGE_LABEL_IN_VALUE);
                if (inMessage != null) {
                    inMessage.setElementQName(table.getComplexScheamType(jmethod.getSimpleName() +
                            SchemaGenerator.METHOD_REQUEST_WRAPPER));
                }
                if (!jmethod.getReturnType().isVoidType()) {
                    AxisMessage outMessage = operation.getMessage(
                            WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
                    outMessage.setElementQName(table.getQNamefortheType(jmethod.getSimpleName() +
                            SchemaGenerator.METHOD_RESPONSE_WRAPPER));
                }
            } else {
                operation = getAxisOperationforJmethod(jmethod, table);
                MessageReceiver mr = axisService.getMessageReceiver(
View Full Code Here


        String opName = jmethod.getSimpleName();
        if (jmethod.getReturnType().isVoidType()) {
            operation = AxisOperationFactory.getAxisOperation(WSDLConstants.MEP_CONSTANT_IN_ONLY);
        } else {
            operation = AxisOperationFactory.getAxisOperation(WSDLConstants.MEP_CONSTANT_IN_OUT);
            AxisMessage outMessage = operation.getMessage(
                    WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
            outMessage.setElementQName(table.getQNamefortheType(jmethod.getSimpleName() +
                    SchemaGenerator.METHOD_RESPONSE_WRAPPER));
        }

        operation.setName(new QName(opName));
        AxisMessage inMessage = operation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
        if (inMessage != null) {
            inMessage.setElementQName(table.getComplexScheamType(jmethod.getSimpleName() +
                    SchemaGenerator.METHOD_REQUEST_WRAPPER));
        }
        return operation;
    }
View Full Code Here

            if (lable == null) {
                throw new DeploymentException("message lebel can not be null");
            }

            AxisMessage message = operation.getMessage(lable.getAttributeValue());

            Iterator parameters = messageElement.getChildrenWithName(new QName(TAG_PARAMETER));

            // setting the PolicyInclude
//            PolicyInclude policyInclude = message.getPolicyInclude();

            // processing <wsp:Policy> .. </..> elements
            Iterator policyElements = messageElement.getChildrenWithName(new QName(POLICY_NS_URI, TAG_POLICY));

            if (policyElements != null) {
                processPolicyElements(PolicyInclude.AXIS_MESSAGE_POLICY, policyElements, message.getPolicyInclude());
            }

            // processing <wsp:PolicyReference> .. </..> elements
            Iterator policyRefElements = messageElement.getChildrenWithName(new QName(POLICY_NS_URI, TAG_POLICY_REF));

            if (policyRefElements != null) {
                processPolicyRefElements(PolicyInclude.AXIS_MESSAGE_POLICY, policyRefElements, message.getPolicyInclude());
            }

            processParameters(parameters, message, operation);

        }
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

        addPolicyAsExtElements(description, policyList, wsdlBindingOperation,
                policyInclude);

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

            // wsdl:Binding -> wsdl:Operation -> wsdl:Input
            List policyList2 = policyInclude2
                    .getPolicyElements(PolicyInclude.INPUT_POLICY);
            addPolicyAsExtElements(description, policyList2,
                    wsdlBindingOperation.getInput(), policyInclude2);

            //
            policyList2 = policyInclude2
                    .getPolicyElements(PolicyInclude.AXIS_MESSAGE_POLICY);
            addPolicyAsExtElements(description, policyList2,
                    wsdlBindingOperation.getInput(), 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:Binding -> wsdl:Operation -> wsdl:Input
            policyList2 = policyInclude2
                    .getPolicyElements(PolicyInclude.INPUT_POLICY);
            addPolicyAsExtElements(description, policyList2,
                    wsdlBindingOperation.getInput(), policyInclude2);
            //
            policyList2 = policyInclude2
                    .getPolicyElements(PolicyInclude.AXIS_MESSAGE_POLICY);
            addPolicyAsExtElements(description, policyList2,
                    wsdlBindingOperation.getInput(), policyInclude2);

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

            // wsdl:Binding -> wsdl:Operation -> wsdl:Output
            policyList2 = policyInclude2
                    .getPolicyElements(PolicyInclude.OUTPUT_POLICY);
            addPolicyAsExtElements(description, policyList2,
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) {
                                SchemaGlobalElement xmlbeansElement =
                                        sts.findElement(message.getElementQName());
                                SchemaType sType = xmlbeansElement.getType();

                                SchemaProperty[] elementProperties = sType.getElementProperties();
                                for (int i = 0; i < elementProperties.length; i++) {
                                    SchemaProperty elementProperty = elementProperties[i];

                                    QName partQName =
                                            WSDLUtil.getPartQName(op.getName().getLocalPart(),
                                                                  WSDLConstants.INPUT_PART_QNAME_SUFFIX,
                                                                  elementProperty
                                                                          .getName().getLocalPart());

                                    //this type is based on a primitive type- use the
                                    //primitive type name in this case
                                    String fullJaveName =
                                            elementProperty.getType().getFullJavaName();
                                    if (elementProperty.extendsJavaArray()) {
                                        fullJaveName = fullJaveName.concat("[]");
                                    }
                                    mapper.addTypeMappingName(partQName, fullJaveName);
                                    SchemaType primitiveType =
                                            elementProperty.getType().getPrimitiveType();


                                    if (primitiveType != null) {
                                        mapper.addTypeMappingStatus(partQName, Boolean.TRUE);
                                    }
                                    if (elementProperty.extendsJavaArray()) {
                                        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) {
                                SchemaGlobalElement xmlbeansElement =
                                        sts.findElement(message.getElementQName());
                                SchemaType sType = xmlbeansElement.getType();

                                SchemaProperty[] elementProperties = sType.getElementProperties();
                                for (int i = 0; i < elementProperties.length; i++) {
                                    SchemaProperty elementProperty = elementProperties[i];
View Full Code Here

            while (operations.hasNext()) {

                // get the basic operation information
                AxisOperation op = (AxisOperation)operations.next();
                String mep = op.getMessageExchangePattern();
                AxisMessage inmsg = null;
                AxisMessage outmsg = null;
                if (WSDLUtil.isInputPresentForMEP(mep)) {
                    inmsg = op.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
                    if (inmsg == null) {
                        throw new RuntimeException(
                                "Expected input message not found for operation " + op.getName());
                    }
                    ArrayList headers = inmsg.getSoapHeaders();
                    for (int i = 0; i < headers.size(); i++) {
                        SOAPHeaderMessage header = (SOAPHeaderMessage)headers.get(i);
                        String cname = mapMessage(header, elementMap);
                        objins.add(cname);
                        if (mappedclass == null && isLookupClass(cname)) {
                            mappedclass = cname;
                        }
                    }
                }
                if (WSDLUtil.isOutputPresentForMEP(mep)) {
                    outmsg = op.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
                    if (outmsg == null) {
                        throw new RuntimeException(
                                "Expected output message not found for operation " + op.getName());
                    }
                    ArrayList headers = outmsg.getSoapHeaders();
                    for (int i = 0; i < headers.size(); i++) {
                        SOAPHeaderMessage header = (SOAPHeaderMessage)headers.get(i);
                        String cname = mapMessage(header, elementMap);
                        objouts.add(cname);
                        if (mappedclass == null && isLookupClass(cname)) {
View Full Code Here

                operationContext.addMessageContext(inMessageContext);
            }
            AxisOperation axisOp = operationContext.getAxisOperation();
            //TODO need to handle fault case as well ,
            //TODO  need to check whether the message contains fault , if so we need to get the fault message
            AxisMessage inMessage = axisOp.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
            inMessageContext.setAxisMessage(inMessage);
            inMessageContext.setServerSide(false);
        } else {
            msgCtx.setOperationContext(operationContext);
            msgCtx.setServiceContext(outMessageContext.getServiceContext());
            AxisOperation axisOp = operationContext.getAxisOperation();
            AxisMessage inMessage = axisOp.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
            msgCtx.setAxisMessage(inMessage);
            msgCtx.setTransportIn(inMessageContext.getTransportIn());
            msgCtx.setTransportOut(inMessageContext.getTransportOut());
            msgCtx.setServerSide(false);
            msgCtx.setProperty(org.apache.axis2.transport.mail.Constants.CONTENT_TYPE,
View Full Code Here

    String tmpElementName = null;

    // -------------------------------------
    // first try the "out" message
    // -------------------------------------
    AxisMessage out = null;
    try {
      out = op.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
    } catch (Exception ex) {
      // just absorb the exception
    }

    if (out != null) {
      tmpName = out.getName();

      QName tmpQout = out.getElementQName();
      if (tmpQout != null) {
        tmpElementName = tmpQout.toString();
      }
    }

    // check the criteria for a match

    boolean matching = matchMessageNames(tmpName, tmpElementName, msgName,
        msgElementName);

    if (matching) {
      // trace point
      if (log.isTraceEnabled()) {
        log
            .trace("ObjectStateUtils:findMessage(): returning OUT message  ["
                + msgName + "]  [" + msgElementName + "] ");
      }

      return out;
    }

    // -------------------------------------
    // next, try the "in" message
    // -------------------------------------
    AxisMessage in = null;
    try {
      in = op.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
    } catch (Exception ex) {
      // just absorb the exception
    }

    if (in != null) {
      tmpName = in.getName();

      QName tmpQin = in.getElementQName();
      if (tmpQin != null) {
        tmpElementName = tmpQin.toString();
      }
    } else {
      tmpName = null;
View Full Code Here

     */
    protected void generateAndPopulateFaultNames() {
        //loop through and find the faults
        Iterator operations = axisService.getOperations();
        AxisOperation operation;
        AxisMessage faultMessage;
        while (operations.hasNext()) {
            operation = (AxisOperation) operations.next();
            ArrayList faultMessages = operation.getFaultMessages();
            for (int i = 0; i < faultMessages.size(); i++) {
                faultMessage = (AxisMessage) faultMessages.get(i);
                //make a unique name and put that in the hashmap
                if (!fullyQualifiedFaultClassNameMap.
                        containsKey(faultMessage.getName())) {
                    //make a name
                    String className = makeJavaClassName(faultMessage.getName());
                    QName faultQName = new QName(codeGenConfiguration.getTargetNamespace(), faultMessage.getName());
                    if (this.mapper.getQNameToMappingObject(faultQName) != null) {
                        // i.e we already have an entry
                        className = makeJavaClassName(className + "Exception" + (uniqueFaultNameCounter++));
                    }
                    while (fullyQualifiedFaultClassNameMap.containsValue(className)) {
                        className = makeJavaClassName(className + (uniqueFaultNameCounter++));
                    }

                    fullyQualifiedFaultClassNameMap.put(
                            faultMessage.getName(),
                            className);
                    //we've to keep track of the fault base names seperately
                    faultClassNameMap.put(faultMessage.getName(),
                            className);

                    faultElementQNameMap.put(faultMessage.getName(),
                            faultMessage.getElementQName());

                }
            }

        }
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.