Package org.apache.axis2.description

Examples of org.apache.axis2.description.AxisOperation


            // get the implementation class for the Web Service
            Object obj = getTheImplementationObject(inMessage);

            Class ImplClass = obj.getClass();

            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;
            String methodName = op.getName().getLocalPart();
            Method[] methods = ImplClass.getMethods();
            for (int i = 0; i < methods.length; i++) {
                if (methods[i].getName().equals(methodName)) {
                    this.method = methods[i];
                    break;
                }
            }
            Object resObject = null;
            if (inAxisMessage != null) {
                if (inAxisMessage.getElementQName() == null) {
                    // method accept empty SOAPbody
                    resObject = method.invoke(obj, new Object[0]);
                } else {
                    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 = RPCUtil.processRequest(methodElement, method,
                            inMessage.getAxisService().getObjectSupplier());
                    resObject = method.invoke(obj, objectArray);
                }

            }


            SOAPFactory fac = getSOAPFactory(inMessage);

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

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


            // get the implementation class for the Web Service
            Object obj = getTheImplementationObject(inMessage);

            Class ImplClass = obj.getClass();

            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;
            QName elementQName;
            String methodName = op.getName().getLocalPart();
            Method[] methods = ImplClass.getMethods();
            for (int i = 0; i < methods.length; i++) {
                if (methods[i].getName().equals(methodName)) {
                    this.method = methods[i];
                    break;
View Full Code Here

            // get the implementation class for the Web Service
            Object obj = getTheImplementationObject(inMessage);

            Class ImplClass = obj.getClass();

            AxisOperation op = inMessage.getOperationContext().getAxisOperation();

            OMElement methodElement = inMessage.getEnvelope().getBody()
                    .getFirstElement();

            AxisMessage inAxisMessage = op.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
            String messageNameSpace;
            QName elementQName;
            String methodName = op.getName().getLocalPart();
            Method[] methods = ImplClass.getMethods();
            for (int i = 0; i < methods.length; i++) {
                if (methods[i].getName().equals(methodName)) {
                    this.method = methods[i];
                    break;
View Full Code Here

        return axisService;
    }

    protected void initAxisOperations(AxisService axisService) {
        for (Iterator<?> i = axisService.getOperations(); i.hasNext();) {
            AxisOperation axisOp = (AxisOperation)i.next();
            Operation op = getOperation(axisOp);
            if (op != null) {

                if (op.isNonBlocking()) {
                    axisOp.setMessageExchangePattern(WSDL2Constants.MEP_URI_IN_ONLY);
                } else {
                    axisOp.setMessageExchangePattern(WSDL2Constants.MEP_URI_IN_OUT);
                }

                MessageReceiver msgrec = null;
                if (op.isNonBlocking()) {
                    msgrec = new Axis2ServiceInMessageReceiver(this, op, policyHandlerList);
                } else {
                    msgrec = new Axis2ServiceInOutSyncMessageReceiver(this, op, policyHandlerList);
                }
                axisOp.setMessageReceiver(msgrec);
            }
        }
    }
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

    public static void createAxisServiceProviders(AxisService axisService,
                                                  RuntimeEndpoint endpoint,
                                                  WebServiceBinding wsBinding,
                                                  ExtensionPointRegistry extensionPoints) {
        for (Iterator<?> i = axisService.getOperations(); i.hasNext();) {
            AxisOperation axisOp = (AxisOperation)i.next();
            Operation op = getOperation(axisOp, wsBinding);
            if (op != null) {

                if (op.isNonBlocking()) {
                    axisOp.setMessageExchangePattern(WSDL2Constants.MEP_URI_IN_ONLY);
                } else {
                    axisOp.setMessageExchangePattern(WSDL2Constants.MEP_URI_IN_OUT);
                }

                MessageReceiver msgrec = null;
                TuscanyServiceProvider serviceProvider = new TuscanyServiceProvider(extensionPoints, endpoint, wsBinding, op);
                if (op.isNonBlocking()) {
                    msgrec = new Axis2ServiceInMessageReceiver(serviceProvider);
                } else {
                    msgrec = new Axis2ServiceInOutSyncMessageReceiver(serviceProvider);
                }
                axisOp.setMessageReceiver(msgrec);
            }
        }
    }   
View Full Code Here

    ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(
        repoPath, axis2_xml);

    AxisConfiguration axisConfiguration = configContext.getAxisConfiguration();
    AxisService axisService = axisConfiguration.getService("RMSampleService");
    AxisOperation operation = AxisOperationFactory.getAxisOperation(WSDL20_2004Constants.MEP_CONSTANT_IN_ONLY);
    operation.setMessageReceiver(new MTOMTestMessageReceiver());
    operation.setName(new QName(MTOMping));
    axisService.addOperation(operation);

    AxisOperation pingOperation = axisService.getOperation(new QName(PING_OPERATION_NAME));
    if (pingOperation == null)
      throw new AxisFault("Cant find the ping operation");

    // setting the operation specific phase chain
    operation.setRemainingPhasesInFlow(pingOperation.getRemainingPhasesInFlow());

    String serverPortStr = getTestProperty("test.server.port");
    if (serverPortStr != null) {
      try {
        serverPort = Integer.parseInt(serverPortStr);
View Full Code Here

    ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(
        repoPath, axis2_xml);

    AxisConfiguration axisConfiguration = configContext.getAxisConfiguration();
    AxisService axisService = axisConfiguration.getService("RMSampleService");
    AxisOperation operation = AxisOperationFactory.getAxisOperation(WSDL20_2004Constants.MEP_CONSTANT_IN_ONLY);
    operation.setMessageReceiver(new TestMessageReceiver());
    operation.setName(new QName(TEST_OPERATION_NAME));
    axisService.addOperation(operation);

    AxisOperation pingOperation = axisService.getOperation(new QName("ping"));
    if (pingOperation == null)
      throw new AxisFault("Cant find the ping operation");

    // setting the operation specific phase chain
    operation.setRemainingPhasesInFlow(pingOperation.getRemainingPhasesInFlow());

    httpServer = new SimpleHTTPServer(configContext, serverPort);
    httpServer.start();
    try {
      Thread.sleep(300);
View Full Code Here

    public void overrideConfigurationContext (ConfigurationContext context,MessageReceiver messageReceiver, String operationName, boolean newOperation, int mep) throws Exception  {
     
     
      AxisService rmService = context.getAxisConfiguration().getService(RMServiceName);
     
      AxisOperation operation = null;
     
      if (newOperation) {
        operation = rmService.getOperation(new QName (operationName));
        if (operation==null)
          throw new Exception ("Given operation not found");
      } else {
        operation = AxisOperationFactory.getAxisOperation(mep);
        rmService.addOperation(operation);
      }
     
      operation.setMessageReceiver(messageReceiver);
    }
View Full Code Here

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

                    for (; iterator.hasNext();) {
                        AxisOperation axisOperation = (AxisOperation) iterator.next();
                        resultBuf.append("<li>" + axisOperation.getName().getLocalPart() + "</li>");
                    }
                    resultBuf.append("</ul>");
                } else {
                    resultBuf.append("No operations specified for this service");
                }
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.