Package org.apache.axis2.description

Examples of org.apache.axis2.description.AxisMessage


    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


                Input wsdl4jInput = wsdl4jOperation.getInput();
                BindingInput wsdl4jBindingInput = wsdl4jBindingOperation
                        .getBindingInput();
                Message wsdl4jInputMessage = wsdl4jInput.getMessage();

                AxisMessage axisInputMessage = axisOperation
                        .getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);

                // ////////////////// adding Policies /////////////////////////

                PolicyInclude inputPolicyInclue = axisInputMessage
                        .getPolicyInclude();
                inputPolicyInclue.setPolicyRegistry(operationPolicyInclude.getPolicyRegistry());
               
                List inputMessagePolicies;

                // wsdl:PortType -> wsdl:Operation -> wsdl:Input
                inputMessagePolicies = getPoliciesAsExtAttributes(wsdl4jInput
                        .getExtensionAttributes());
                addPolicyElements(PolicyInclude.INPUT_POLICY,
                        inputMessagePolicies, inputPolicyInclue);

                // wsdl:Binding -> wsdl:Operation -> wsdl:Input
                inputMessagePolicies = getPoliciesAsExtElements(wsdl4jBindingInput
                        .getExtensibilityElements());
                addPolicyElements(PolicyInclude.BINDING_INPUT_POLICY,
                        inputMessagePolicies, inputPolicyInclue);

                // wsdl:Message
                inputMessagePolicies = getPoliciesAsExtElements(wsdl4jInputMessage
                        .getExtensibilityElements());
                addPolicyElements(PolicyInclude.MESSAGE_POLICY,
                        inputMessagePolicies, inputPolicyInclue);

                // /////////////////////////////////////////////////////////////

                // setting the element qname
                QName elementName = generateReferenceQname(
                        new QName(wsdl4jPortType.getQName().getNamespaceURI(),
                                wsdl4jOperation.getName()), wsdl4jInputMessage,
                        findWrapppable(wsdl4jInputMessage),
                        resolvedRPCWrapperElements);
                axisInputMessage.setElementQName(elementName);

                // setting wsa:Action
                String wsaActionForInput = getWsaAction(wsdl4jInput
                        .getExtensionAttributes());

                if (wsaActionForInput != null
                        && wsaActionForInput.length() != 0) {
                    axisService.mapActionToOperation(wsaActionForInput,
                            axisOperation);
                }

                Output wsdl4jOutput = wsdl4jOperation.getOutput();
                BindingOutput wsdl4jBindingOutput = wsdl4jBindingOperation
                        .getBindingOutput();

                if (wsdl4jOutput != null) {

                    AxisMessage axisOutputMessage = axisOperation
                            .getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);

                    Message wsdl4jOutputMessage = wsdl4jOutput.getMessage();

                    // ///////////// adding Policies ///////////////////////////

                    PolicyInclude outputPolicyInclude = axisOutputMessage
                            .getPolicyInclude();
                    outputPolicyInclude.setPolicyRegistry(operationPolicyInclude.getPolicyRegistry());
                    List outputPolicies;

                    // wsdl:Output
                    outputPolicies = getPoliciesAsExtAttributes(wsdl4jOutput
                            .getExtensionAttributes());
                    addPolicyElements(PolicyInclude.OUTPUT_POLICY,
                            outputPolicies, outputPolicyInclude);

                    if (wsdl4jBindingOutput != null) {
                        // BindingOutput
                        outputPolicies = getPoliciesAsExtElements(wsdl4jBindingOutput
                                .getExtensibilityElements());
                        if (outputPolicies != null) {
                            addPolicyElements(PolicyInclude.BINDING_OUTPUT_POLICY,
                                    outputPolicies, outputPolicyInclude);
                        }
                    }

                    // wsdl:Message
                    outputPolicies = getPoliciesAsExtElements(wsdl4jOutputMessage
                            .getExtensibilityElements());
                    addPolicyElements(PolicyInclude.MESSAGE_POLICY,
                            outputPolicies, outputPolicyInclude);

                    // /////////////////////////////////////////////////////////

                    // setting the element qname
                    QName outElementName = generateReferenceQname(
                            new QName(wsdl4jOperation.getName()),
                            wsdl4jOutputMessage,
                            findWrapppable(wsdl4jOutputMessage),
                            resolvedRPCWrapperElements);
                    axisOutputMessage.setElementQName(outElementName);
                    // setting the wsa:Action
                    String wsaActionForOutput = getWsaAction(wsdl4jOutput
                            .getExtensionAttributes());

                    if (wsaActionForOutput != null
View Full Code Here

        ArrayList params = new ArrayList();
        ArrayList faultMessages = operation.getFaultMessages();

        if (faultMessages != null && !faultMessages.isEmpty()) {
            Element paramElement;
            AxisMessage msg;
            for (int i = 0; i < faultMessages.size(); i++) {
                paramElement = doc.createElement("param");
                msg = (AxisMessage)faultMessages.get(i);
                String msgClassName = WSDL2JavaGenerator.normalizeClassName(msg.getName());
                addAttribute(doc, "name", msgClassName, paramElement);
                params.add(paramElement);
            }

            return (Element[])params.toArray(new Element[params.size()]);
View Full Code Here

            // 3. extract the schema from the operation.
            AxisOperation axisOperation = msgContext.getAxisOperation();

            XmlSchemaElement xmlSchemaElement = null;
            if (axisOperation != null) {
                AxisMessage axisMessage = axisOperation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
                xmlSchemaElement = axisMessage.getSchemaElement();
            }

            SOAPEnvelope soapEnvelope = SchemaUtil.handleMediaTypeURLEncoded(msgContext,
                    request,
                    xmlSchemaElement,
View Full Code Here

            if (lable == null) {
                throw new DeploymentException(Messages.getMessage("messagelabelcannotfound"));
            }

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

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

            // 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

    assertNotNull(axisOperation);

    assertEquals(WSDLConstants.MEP_URI_IN_OUT, axisOperation
        .getMessageExchangePattern());

    AxisMessage input = axisOperation
        .getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
    assertNotNull(input);
    assertEquals(input.getParent(), axisOperation);
    assertEquals(input.getElementQName(), new QName(
        "http://ws.apache.org/axis2/tests", "Echo"));

    AxisMessage output = axisOperation
        .getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
    assertNotNull(output);
    assertEquals(output.getParent(), axisOperation);
    assertEquals(output.getElementQName(), new QName(
        "http://ws.apache.org/axis2/tests", "EchoResponse"));
  }
View Full Code Here

    assertNotNull(axisOperation);

    assertEquals(WSDLConstants.MEP_URI_IN_OUT, axisOperation
        .getMessageExchangePattern());

    AxisMessage input = axisOperation
        .getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
    assertNotNull(input);
    assertEquals(input.getParent(), axisOperation);
    assertEquals(input.getElementQName(), new QName(
        "http://ws.apache.org/axis2/tests", "Echo"));

    AxisMessage output = axisOperation
        .getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
    assertNotNull(output);
    assertEquals(output.getParent(), axisOperation);
    assertEquals(output.getElementQName(), new QName(
        "http://ws.apache.org/axis2/tests", "EchoResponse"));
  }
View Full Code Here

                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.getComplexSchemaType(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

        }
        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.getComplexSchemaType(jmethod.getSimpleName() +
                    SchemaGenerator.METHOD_REQUEST_WRAPPER));
        }
        return operation;
    }
View Full Code Here

        Input wsdl4jInput = wsdl4jOperation.getInput();
        BindingInput wsdl4jBindingInput = wsdl4jBindingOperation
            .getBindingInput();
        Message wsdl4jInputMessage = wsdl4jInput.getMessage();

        AxisMessage axisInputMessage = axisOperation
            .getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);

        // ////////////////// adding Policies /////////////////////////

        PolicyInclude inputPolicyInclue = new PolicyInclude(
            axisOperation.getPolicyInclude());

        List inputMessagePolicies;

        // wsdl:PortType -> wsdl:Operation -> wsdl:Input
        inputMessagePolicies = getPoliciesAsExtAttributes(wsdl4jInput
            .getExtensionAttributes());
        addPolicyElements(PolicyInclude.INPUT_POLICY,
            inputMessagePolicies, inputPolicyInclue);

        // wsdl:Binding -> wsdl:Operation -> wsdl:Input
        inputMessagePolicies = getPoliciesAsExtElements(wsdl4jBindingInput
            .getExtensibilityElements());
        addPolicyElements(PolicyInclude.BINDING_INPUT_POLICY,
            inputMessagePolicies, inputPolicyInclue);

        // wsdl:Message
        inputMessagePolicies = getPoliciesAsExtElements(wsdl4jInputMessage
            .getExtensibilityElements());
        addPolicyElements(PolicyInclude.MESSAGE_POLICY,
            inputMessagePolicies, inputPolicyInclue);

        axisInputMessage.setPolicyInclude(policyInclude);

        // /////////////////////////////////////////////////////////////

        // setting the element qname
        axisInputMessage.setElementQName(generateReferenceQname(
            new QName(wsdl4jPortType.getQName().getNamespaceURI(),
                wsdl4jOperation.getName()), wsdl4jInputMessage,
            findWrapppable(wsdl4jInputMessage),
            resolvedRPCWrapperElements));

        // setting wsa:Action
        String wsaActionForInput = getWsaAction(wsdl4jInput
            .getExtensionAttributes());

        if (wsaActionForInput != null
            && wsaActionForInput.length() != 0) {
          axisService.mapActionToOperation(wsaActionForInput,
              axisOperation);
        }

        Output wsdl4jOutput = wsdl4jOperation.getOutput();
        BindingOutput wsdl4jBindingOutput = wsdl4jBindingOperation
            .getBindingOutput();

        if (wsdl4jOutput != null) {

          AxisMessage axisOutputMessage = axisOperation
              .getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);

          Message wsdl4jOutputMessage = wsdl4jOutput.getMessage();

          // ///////////// adding Policies ///////////////////////////

          PolicyInclude outputPolicyInclude = new PolicyInclude(
              axisService.getPolicyInclude());
          List outputPolicies;

          // wsdl:Output
          outputPolicies = getPoliciesAsExtAttributes(wsdl4jOutput
              .getExtensionAttributes());
          addPolicyElements(PolicyInclude.OUTPUT_POLICY,
              outputPolicies, outputPolicyInclude);

          // BindingOutput
          outputPolicies = getPoliciesAsExtElements(wsdl4jBindingOutput
              .getExtensibilityElements());
          addPolicyElements(PolicyInclude.BINDING_OUTPUT_POLICY,
              outputPolicies, outputPolicyInclude);

          // wsdl:Message
          outputPolicies = getPoliciesAsExtElements(wsdl4jOutputMessage
              .getExtensibilityElements());
          addPolicyElements(PolicyInclude.MESSAGE_POLICY,
              outputPolicies, outputPolicyInclude);

          axisOutputMessage.setPolicyInclude(outputPolicyInclude);

          // /////////////////////////////////////////////////////////

          // setting the element qname
          axisOutputMessage.setElementQName(generateReferenceQname(
              new QName(wsdl4jOperation.getName()),
              wsdl4jOutputMessage,
              findWrapppable(wsdl4jOutputMessage),
              resolvedRPCWrapperElements));
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.