Package org.apache.axis2.description

Examples of org.apache.axis2.description.AxisOperation


            String opName = null;

            if (synCtx.getProperty(SynapseConstants.ENDPOINT_OPERATION) != null) {
                opName = synCtx.getProperty(SynapseConstants.ENDPOINT_OPERATION).toString();
            } else if (synCtx instanceof Axis2MessageContext) {
                AxisOperation operation
                        = ((Axis2MessageContext) synCtx).getAxis2MessageContext().getAxisOperation();
                if (operation != null) {
                    opName = operation.getName().getLocalPart();
                }
                if (opName == null ||
                        SynapseConstants.SYNAPSE_OPERATION_NAME.getLocalPart().equals(opName)) {
                    String soapAction = synCtx.getSoapAction();
                    opName = null;
View Full Code Here


    JMethod[] method = soapService.schemaGenerator.getMethods();
    PhasesInfo pinfo = axisConfiguration.getPhasesInfo();
    for (int i = 0; i < method.length; i++) {
      JMethod         jmethod   = method[i];
      AxisOperation   operation = axisService.getOperation(new QName(jmethod.getSimpleName()));
      String          mep       = operation.getMessageExchangePattern();
      MessageReceiver mr;

      if (messageReceiverClassMap != null) {       
        if (messageReceiverClassMap.get(mep) != null) {
          Object obj = messageReceiverClassMap.get(mep);
          if (obj instanceof MessageReceiver) {
            mr = (MessageReceiver) obj;
            operation.setMessageReceiver(mr);
          } else {
            Activator.log.error("Object is not an instance of MessageReceiver," +
                                " thus, default MessageReceiver has been set");
            mr = axisConfiguration
              .getMessageReceiver(operation.getMessageExchangePattern());
            operation.setMessageReceiver(mr);
          }
        } else {
          Activator.log.error("Required MessageReceiver couldn't be found," +
                              " thus, default MessageReceiver has been used");
          mr = axisConfiguration
            .getMessageReceiver(operation.getMessageExchangePattern());
          operation.setMessageReceiver(mr);
        }
      } else {
        Activator.log.error("MessageReceiverClassMap couldn't be found," +
                            " thus, default MessageReceiver has been used");
        mr = axisConfiguration.getMessageReceiver(operation.getMessageExchangePattern());
        operation.setMessageReceiver(mr);
      }
      pinfo.setOperationPhases(operation);
      axisService.addOperation(operation);
    }
    return axisService;
View Full Code Here

     * @param eventSourceService service
     * @throws AxisFault         axis fault
     */
    private void addOperations(AxisService eventSourceService) throws AxisFault {
        // Create operations
        AxisOperation mediateOperation =
                new InOutAxisOperation(SynapseConstants.SYNAPSE_OPERATION_NAME);
        AxisOperation subscribeOperation =
                new InOutAxisOperation(new QName(EventingConstants.WSE_SUBSCRIBE_OP));
        AxisOperation unsubscribeOperation =
                new InOutAxisOperation(new QName(EventingConstants.WSE_UNSUBSCRIBE_OP));
        AxisOperation renewOperation =
                new InOutAxisOperation(new QName(EventingConstants.WSE_RENEW_OP));
        AxisOperation getStatusOperation =
                new InOutAxisOperation(new QName(EventingConstants.WSE_GET_STATUS_OP));
        AxisOperation subscriptionEndOperation =
                new InOutAxisOperation(new QName(EventingConstants.WSE_SUBSCRIPTIONEND_OP));
        // Assign the message reciver
        mediateOperation.setMessageReceiver(this);
        subscribeOperation.setMessageReceiver(this);
        unsubscribeOperation.setMessageReceiver(this);
        renewOperation.setMessageReceiver(this);
        getStatusOperation.setMessageReceiver(this);
        subscriptionEndOperation.setMessageReceiver(this);       
        // Set Soap Action
        subscribeOperation.setSoapAction(EventingConstants.WSE_SUBSCRIBE);
        unsubscribeOperation.setSoapAction(EventingConstants.WSE_UNSUBSCRIBE);
        renewOperation.setSoapAction(EventingConstants.WSE_RENEW);
        getStatusOperation.setSoapAction(EventingConstants.WSE_GET_STATUS);
View Full Code Here

            String opName = null;

            if (synCtx.getProperty(SynapseConstants.ENDPOINT_OPERATION) != null) {
                opName = synCtx.getProperty(SynapseConstants.ENDPOINT_OPERATION).toString();
            } else if (synCtx instanceof Axis2MessageContext) {
                AxisOperation operation
                        = ((Axis2MessageContext) synCtx).getAxis2MessageContext().getAxisOperation();
                if (operation != null) {
                    opName = operation.getName().getLocalPart();
                }
                if (opName == null ||
                        SynapseConstants.SYNAPSE_OPERATION_NAME.getLocalPart().equals(opName)) {
                    String soapAction = synCtx.getSoapAction();
                    opName = null;
View Full Code Here

                else
                    return SynapseConstants.FORMAT_SOAP12;
            } else if (SynapseConstants.PROPERTY_OPERATION_NAME.equals(key) ||
                       SynapseConstants.PROPERTY_OPERATION_NAMESPACE.equals(key)) {
                if (synCtx instanceof Axis2MessageContext) {
                    AxisOperation axisOperation
                        = ((Axis2MessageContext)synCtx).getAxis2MessageContext().getAxisOperation();
                    if (axisOperation != null) {
                        if (SynapseConstants.PROPERTY_OPERATION_NAMESPACE.equals(key)) {
                            return axisOperation.getName().getNamespaceURI();
                        } else {
                            return axisOperation.getName().getLocalPart();
                        }
                    }
                }
            } else {
                Object result = synCtx.getProperty(key);
View Full Code Here

                if (iterator.hasNext()) {
                    resultBuf.append("Available operations <ul>");

                    for (; iterator.hasNext();) {
                        AxisOperation axisOperation = (AxisOperation) iterator.next();
                        resultBuf.append("<li>").append(
                                axisOperation.getName().getLocalPart()).append("</li>");
                    }
                    resultBuf.append("</ul>");
                } else {
                    resultBuf.append("No operations specified for this service");
                }
View Full Code Here

     * created before calling this method since, for a DOC/LIT/BARE (aka UNWRAPPED) message, the
     * ParamaterDescription is used to setup the AxisMessage correctly for use in SOAP Body-based
     * dispatching on incoming DOC/LIT/BARE messages.
     */
    private AxisOperation createAxisOperation() {
        AxisOperation newAxisOperation = null;
        try {
            if (isOneWay()) {
                newAxisOperation = AxisOperationFactory
                        .getOperationDescription(WSDL2Constants.MEP_URI_IN_ONLY);
            } else {
                newAxisOperation =
                        AxisOperationFactory.getOperationDescription(WSDL2Constants.MEP_URI_IN_OUT);
            }
            //TODO: There are several other MEP's, such as: OUT_ONLY, IN_OPTIONAL_OUT, OUT_IN, OUT_OPTIONAL_IN, ROBUST_OUT_ONLY,
            //                                              ROBUST_IN_ONLY
            //      Determine how these MEP's should be handled, if at all
        } catch (Exception e) {
            if (log.isDebugEnabled()) {
                log.debug(
                        "Unable to build AxisOperation for OperationDescrition; caught exception.",
                        e);
            }
            // TODO: NLS & RAS
            throw ExceptionFactory
                    .makeWebServiceException("Caught exception trying to create AxisOperation", e);
        }

        newAxisOperation.setName(determineOperationQName(this.methodComposite));
        newAxisOperation.setSoapAction(this.getAction());

        //REVIEW: Determine if other axisOperation values may need to be set
        //      Currently, the following values are being set on AxisOperation in
        //      ServiceBuilder.populateService which we are not setting:
        //          AxisOperation.setPolicyInclude()
        //          AxisOperation.setWsamappingList()
        //          AxisOperation.setOutputAction()
        //          AxisOperation.addFaultAction()
        //          AxisOperation.setFaultMessages()

        // If this is a DOC/LIT/BARE operation, then set the QName of the input AxisMessage to the
        // part for the first IN or IN/OUT non-header parameter.  If there are no parameters, then don't set
        // anything.  The AxisMessage name is used to do SOAP-body based routing of DOC/LIT/BARE
        // incoming messages.
        if (getSoapBindingStyle() == javax.jws.soap.SOAPBinding.Style.DOCUMENT
                && getSoapBindingUse() == javax.jws.soap.SOAPBinding.Use.LITERAL
                && getSoapBindingParameterStyle() == javax.jws.soap.SOAPBinding.ParameterStyle.BARE)
        {
            ParameterDescription[] paramDescs = getParameterDescriptions();
            if (paramDescs != null && paramDescs.length > 0) {
                for (ParameterDescription paramDesc : paramDescs) {
                    WebParam.Mode paramMode = paramDesc.getMode();
                    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) {
                            // TODO: RAS & NLS
View Full Code Here

     * MessageElementQNameToOperationMapping
     *
     * @param axisService
     */
    void addToAxisService(AxisService axisService) {
        AxisOperation newAxisOperation = getAxisOperation();
        QName axisOpQName = newAxisOperation.getName();
        if (axisService.getOperation(axisOpQName) == null) {
            axisService.addOperation(newAxisOperation);
            // For a Doc/Lit/Bare operation, we also need to add the element mapping
            if (getSoapBindingStyle() == javax.jws.soap.SOAPBinding.Style.DOCUMENT
                    && getSoapBindingUse() == javax.jws.soap.SOAPBinding.Use.LITERAL
                    && getSoapBindingParameterStyle() == javax.jws.soap.SOAPBinding.ParameterStyle
                    .BARE) {
                AxisMessage axisMessage =
                        newAxisOperation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
                if (axisMessage != null) {
                    QName elementQName = axisMessage.getElementQName();
                    if (!DescriptionUtils.isEmpty(elementQName)) {
                        axisService.addMessageElementQNameToOperationMapping(elementQName,
                                                                             newAxisOperation);
View Full Code Here

        AxisService axisService = parentEndpointDescription.getAxisService();
        if (axisService != null) {
            ArrayList publishedOperations = axisService.getPublishedOperations();
            Iterator operationsIterator = publishedOperations.iterator();
            while (operationsIterator.hasNext()) {
                AxisOperation axisOperation = (AxisOperation)operationsIterator.next();
                addOperation(new OperationDescriptionImpl(axisOperation, this));
            }
        }
    }
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

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.