Package org.apache.axis2.description

Examples of org.apache.axis2.description.AxisOperation


        parentEndpointDescription = parent;
        this.dbc = dbc;
       
        // Construct the generic provider AxisOperation to use then construct
        // an OperactionDescription for it.
        AxisOperation genericProviderAxisOp = null;
        try {
            genericProviderAxisOp =
                AxisOperationFactory.getOperationDescription(WSDLConstants.WSDL20_2006Constants.MEP_URI_IN_OUT);
        } catch (AxisFault e) {
            throw ExceptionFactory.makeWebServiceException(Messages.getMessage("eiDescrImplErr"),e);
        }
       
        genericProviderAxisOp.setName(new QName(JAXWS_NOWSDL_PROVIDER_OPERATION_NAME));
        OperationDescription opDesc = new OperationDescriptionImpl(genericProviderAxisOp, this);
       
        addOperation(opDesc);
        AxisService axisService = getEndpointDescription().getAxisService();
        axisService.addOperation(genericProviderAxisOp);
View Full Code Here


            if (DescriptionUtils.createOperationDescription(mdc.getMethodName())) {
                //First check if this operation already exists on the AxisService, if so
                //then use that in the description hierarchy

                AxisService axisService = getEndpointDescription().getAxisService();
                AxisOperation axisOperation = axisService
                        .getOperation(OperationDescriptionImpl.determineOperationQName(mdc));

                OperationDescription operation =
                        new OperationDescriptionImpl(mdc, this, axisOperation);
View Full Code Here

    String acksToStr = acksTo.getAddress();

    if (acksToStr == null)
      throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.acksToStrNotSet));

    AxisOperation ackOperation = null;

    ackOperation = AxisOperationFactory.getOperationDescription(WSDL20_2004Constants.MEP_URI_IN_ONLY);

    AxisOperation rmMsgOperation = referenceRMMessage.getMessageContext().getAxisOperation();
    if (rmMsgOperation != null) {
      ArrayList outFlow = rmMsgOperation.getPhasesOutFlow();
      if (outFlow != null) {
        ackOperation.setPhasesOutFlow(outFlow);
        ackOperation.setPhasesOutFaultFlow(outFlow);
      }
    }
View Full Code Here

    String acksToStr = acksTo.getAddress();

    if (acksToStr == null)
      throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.acksToStrNotSet));

    AxisOperation ackOperation = null;

    try {
      ackOperation = AxisOperationFactory.getOperationDescription(WSDL20_2004Constants.MEP_URI_IN_ONLY);
    } catch (AxisFault e) {
      throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.axisOperationError, e
          .toString()));
    }

    AxisOperation rmMsgOperation = rmMsgCtx.getMessageContext().getAxisOperation();
    if (rmMsgOperation != null) {
      ArrayList outFlow = rmMsgOperation.getPhasesOutFlow();
      if (outFlow != null) {
        ackOperation.setPhasesOutFlow(outFlow);
        ackOperation.setPhasesOutFaultFlow(outFlow);
      }
    }

    MessageContext ackMsgCtx = SandeshaUtil.createNewRelatedMessageContext(rmMsgCtx, ackOperation);

    ackMsgCtx.setProperty(Sandesha2Constants.APPLICATION_PROCESSING_DONE, "true");

    RMMsgContext ackRMMsgCtx = MsgInitializer.initializeMessage(ackMsgCtx);
    ackRMMsgCtx.setRMNamespaceValue(rmMsgCtx.getRMNamespaceValue());

    ackMsgCtx.setMessageID(SandeshaUtil.getUUID());

    SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SandeshaUtil.getSOAPVersion(msgContext.getEnvelope()));

    // Setting new envelope
    SOAPEnvelope envelope = factory.getDefaultEnvelope();
    try {
      ackMsgCtx.setEnvelope(envelope);
    } catch (AxisFault e3) {
      throw new SandeshaException(e3.getMessage());
    }

    ackMsgCtx.setTo(acksTo);
    ackMsgCtx.setReplyTo(msgContext.getTo());
    RMMsgCreator.addAckMessage(ackRMMsgCtx,sequencePropertyKey,sequenceId, storageManager);
    ackRMMsgCtx.getMessageContext().setServerSide(true);
    ackMsgCtx.setProperty(AddressingConstants.WS_ADDRESSING_VERSION, msgContext
        .getProperty(AddressingConstants.WS_ADDRESSING_VERSION)); // TODO
                                      // do
                                      // this
                                      // in
                                      // the
                                      // RMMsgCreator

    String addressingNamespaceURI = SandeshaUtil.getSequenceProperty(sequencePropertyKey,
        Sandesha2Constants.SequenceProperties.ADDRESSING_NAMESPACE_VALUE, storageManager);
    String anonymousURI = SpecSpecificConstants.getAddressingAnonymousURI(addressingNamespaceURI);

    if (anonymousURI.equals(acksTo.getAddress())) {

      AxisEngine engine = new AxisEngine(ackRMMsgCtx.getMessageContext().getConfigurationContext());

      // setting CONTEXT_WRITTEN since acksto is anonymous
      if (rmMsgCtx.getMessageContext().getOperationContext() == null) {
        // operation context will be null when doing in a GLOBAL
        // handler.
        try {
          AxisOperation op = AxisOperationFactory.getAxisOperation(WSDL20_2004Constants.MEP_CONSTANT_IN_OUT);
          OperationContext opCtx = new OperationContext(op);
          rmMsgCtx.getMessageContext().setAxisOperation(op);
          rmMsgCtx.getMessageContext().setOperationContext(opCtx);
        } catch (AxisFault e2) {
          throw new SandeshaException(e2.getMessage());
View Full Code Here

    // this does not work when there is a terminateSequnceResponse
    // TODO do processing of terminateMessagesCorrectly., create a new
    // message instead of sendign the one given by the serviceClient
    // TODO important

    AxisOperation outInAxisOp = new OutInAxisOperation(new QName("temp"));

    AxisOperation referenceInOutOperation = msgContext.getAxisService()
        .getOperation(
            new QName(Sandesha2Constants.RM_IN_OUT_OPERATION_NAME));
    if (referenceInOutOperation == null) {
      String messge = "Cant find the recerence RM InOut operation";
      throw new SandeshaException(messge);
    }

    outInAxisOp.setParent(msgContext.getAxisService());
    // setting flows
    // outInAxisOp.setRemainingPhasesInFlow(referenceInOutOperation.getRemainingPhasesInFlow());
    outInAxisOp.setRemainingPhasesInFlow(referenceInOutOperation
        .getRemainingPhasesInFlow());

    OperationContext opcontext = OperationContextFactory
        .createOperationContext(
            WSDL20_2004Constants.MEP_CONSTANT_OUT_IN, outInAxisOp);
View Full Code Here

    // this does not work when there is a closeSequnceResponse
    // TODO do processing of closeMessagesCorrectly., create a new
    // message instead of sendign the one given by the serviceClient
    // TODO important

    AxisOperation outInAxisOp = new OutInAxisOperation(new QName("temp"));

    AxisOperation referenceInOutOperation = msgContext.getAxisService()
        .getOperation(
            new QName(Sandesha2Constants.RM_IN_OUT_OPERATION_NAME));
    if (referenceInOutOperation == null) {
      String messge = "Cant find the recerence RM InOut operation";
      throw new SandeshaException(messge);
    }

    outInAxisOp.setParent(msgContext.getAxisService());
    // setting flows
    // outInAxisOp.setRemainingPhasesInFlow(referenceInOutOperation.getRemainingPhasesInFlow());
    outInAxisOp.setRemainingPhasesInFlow(referenceInOutOperation
        .getRemainingPhasesInFlow());

    OperationContext opcontext = OperationContextFactory
        .createOperationContext(
            WSDL20_2004Constants.MEP_CONSTANT_OUT_IN, outInAxisOp);
View Full Code Here

        ServiceGroupContext sgc = new ServiceGroupContext(
            axisCfgCtx, (AxisServiceGroup) anoymousService.getParent());
        ServiceContext serviceCtx = sgc.getServiceContext(anoymousService);

        // get a reference to the DYNAMIC operation of the Anonymous Axis2 service
        AxisOperation axisAnonymousOperation = anoymousService.getOperation(
            new QName(AnonymousServiceFactory.DYNAMIC_OPERATION));

        Options clientOptions = new Options();
        clientOptions.setUseSeparateListener(separateListener);
        // if RM is requested,
        if (wsRMEnabled) {
            // if a WS-RM policy is specified, use it
            if (wsRMPolicyKey != null) {
                clientOptions.setProperty(
                    org.apache.synapse.config.xml.Constants.SANDESHA_POLICY,
                    getPolicy(synapseOutMessageContext, wsRMPolicyKey));
            }
            copyRMOptions(originalInMsgCtx, clientOptions);

            // always send each and every message in a new sequence and terminate sequence
            //clientOptions.setProperty("Sandesha2LastMessage", "true");
        }

        // if security is enabled,
        if (wsSecurityEnabled) {
            // if a WS-Sec policy is specified, use it
            if (wsSecPolicyKey != null) {
                clientOptions.setProperty(
                    org.apache.synapse.config.xml.Constants.RAMPART_POLICY,
                    getPolicy(synapseOutMessageContext, wsSecPolicyKey));
            }
        }
        OperationClient mepClient = axisAnonymousOperation.createClient(
            serviceCtx, clientOptions);
        mepClient.addMessageContext(axisOutMsgCtx);

        if (clientOptions.isUseSeparateListener()) {
            mepClient.setCallback(new AsyncCallback(synapseOutMessageContext));
View Full Code Here

        if (as == null) {
            synchronized (RMMediator.class) {
                AxisService emptyRMEngagedService =
                        new AxisService(EMPTY_RM_ENGAGED_SERVICE);
                AxisOperation emptyOperation =
                        new InOutAxisOperation(EMPTY_OPERATION);
                emptyOperation.setMessageReceiver(new EmptyRMMessageReceiver());
                emptyRMEngagedService.addOperation(emptyOperation);
                ac.addService(emptyRMEngagedService);

                as = emptyRMEngagedService;
                AxisModule am = ac
                        .getModule(Constants.SANDESHA2_MODULE_NAME);

                if (am == null) {
                    throw new AxisFault("Sandesha 2 Module couldn't Find");
                }
                emptyRMEngagedService.engageModule(am, ac);
            }
        }


        AxisOperation ao = as.getOperation(EMPTY_OPERATION);
        OperationContext oc =
                OperationContextFactory.createOperationContext(
                        ao.getAxisSpecifMEPConstant(),
                        ao);
        ao.registerOperationContext(mc, oc);

        ServiceContext sc = Utils.fillContextInformation(as, cc);
        oc.setParent(sc);
        mc.setAxisOperation(ao);
        mc.setAxisService(as);
View Full Code Here

            Map nsMap = new HashMap();
            ArrayList wrappers = new ArrayList();
            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);
                        mappedclass = mapMessage(header, elementMap);
                        objins.add(mappedclass);
                    }
                }
                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);
                        mappedclass = mapMessage(header, elementMap);
                        objouts.add(mappedclass);
                    }
                }
                if (unwrap) {
                   
                    // use unwrapping for both input and output
                    String receivername = "jibxReceiver" + opindex++;
                    Element dbmethod = doc.createElement("dbmethod");
                    dbmethod.setAttribute("receiver-name", receivername);
                    dbmethod.setAttribute("method-name", op.getName().getLocalPart());
                    Set nameset = new HashSet(s_reservedWords);
                    if (inmsg != null) {
                        Element wrapper = unwrapMessage(inmsg, false, simpleTypeMap, complexTypeMap, typeMappedClassMap, bindingMap, nameset, nsMap, doc);
                        dbmethod.appendChild(wrapper);
                        wrappers.add(wrapper);
                    }
                    if (outmsg != null) {
                        Element wrapper = unwrapMessage(outmsg, true, simpleTypeMap, complexTypeMap, typeMappedClassMap, bindingMap, nameset, nsMap, doc);
                        dbmethod.appendChild(wrapper);
                        wrappers.add(wrapper);
                    }
                   
                    // save unwrapping information for use in code generation
                    op.addParameter(new Parameter(Constants.DATABINDING_GENERATED_RECEIVER, receivername));
                    op.addParameter(new Parameter(Constants.DATABINDING_GENERATED_IMPLEMENTATION, Boolean.TRUE));
                    op.addParameter(new Parameter(Constants.DATABINDING_OPERATION_DETAILS, dbmethod));
                   
                } else {
                   
                    // concrete mappings, just save the mapped class name(s)
                    if (inmsg != null) {
                        mappedclass = mapMessage(inmsg, elementMap);
                        objins.add(mappedclass);
                    }
                    if (outmsg != null) {
                        mappedclass = mapMessage(outmsg, elementMap);
                        objouts.add(mappedclass);
                    }
                   
                }
               
                // always handle faults as wrapped
                for (Iterator iter = op.getFaultMessages().iterator(); iter.hasNext();) {
                    mappedclass = mapMessage((AxisMessage)iter.next(), elementMap);
                    objfaults.add(mappedclass);
                }
            }
           
View Full Code Here

            if (!cgconfig.isParametersWrapped()) {
                //figure out the unwrapped operations
                AxisService axisService = cgconfig.getAxisService();
                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
View Full Code Here

TOP

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

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.