Package org.apache.axis2.description

Examples of org.apache.axis2.description.OperationDescription


        return method;
    }

    public void testOneWay() throws Exception {
        ServiceDescription service = new ServiceDescription(serviceName);
        OperationDescription operation = new OperationDescription(
                operationName);
        operation.setMessageReceiver(new MessageReceiver() {
            public void receive(MessageContext messgeCtx) throws AxisFault {
                envelope = messgeCtx.getEnvelope();
            }
        });
        service.addOperation(operation);
View Full Code Here


    public void testEchoXMLCompleteASync() throws Exception {

        ConfigurationContext configContext = UtilsMailServer.createClientConfigurationContext();
        ServiceDescription service = new ServiceDescription(serviceName);
        OperationDescription operation = new OperationDescription(
                operationName);
        operation.setMessageReceiver(new MessageReceiver() {
            public void receive(MessageContext messgeCtx) throws AxisFault {
                envelope = messgeCtx.getEnvelope();
            }
        });
        service.addOperation(operation);
View Full Code Here

    protected void setUp() throws Exception {
        UtilServer.start();

        ServiceDescription service = new ServiceDescription(serviceName);
        OperationDescription operation = new OperationDescription(
                operationName);
        operation.setMessageReceiver(new MessageReceiver() {
            public void receive(MessageContext messgeCtx) throws AxisFault {
                envelope = messgeCtx.getEnvelope();
                TestingUtils.campareWithCreatedOMElement(
                        envelope.getBody().getFirstElement());
            }
View Full Code Here

        ServiceDescription service = new ServiceDescription(serviceName);
        service.addParameter(
                new ParameterImpl(AbstractMessageReceiver.SERVICE_CLASS,
                        MessageContextEnabledEcho.class.getName()));
        OperationDescription operation = new OperationDescription(
                operationName);
        operation.setMessageReceiver(new RawXMLINOnlyMessageReceiver());
        service.addOperation(operation);
        service.setClassLoader(Thread.currentThread().getContextClassLoader());
        LocalTransportReceiver.CONFIG_CONTEXT.getAxisConfiguration()
                .addService(service);
        Utils.resolvePhases(
View Full Code Here

        service = new ServiceDescription(serviceName);
        service.setClassLoader(Thread.currentThread().getContextClassLoader());
        service.addParameter(new ParameterImpl(
                        AbstractMessageReceiver.SERVICE_CLASS, EchoSwA.class
                                .getName()));
        OperationDescription axisOp = new OperationDescription(operationName);
        axisOp.setMessageReceiver(new RawXMLINOutMessageReceiver());
        axisOp.setStyle(WSDLService.STYLE_DOC);
        service.addOperation(axisOp);
        UtilServer.deployService(service);

    }
View Full Code Here

        service = new ServiceDescription(serviceName);
        service.setClassLoader(Thread.currentThread().getContextClassLoader());
        service.addParameter(new ParameterImpl(AbstractMessageReceiver.SERVICE_CLASS,
                EchoService.class.getName()));

        OperationDescription axisOp = new OperationDescription(operationName);
        axisOp.setMessageReceiver(new RawXMLINOutMessageReceiver());
        axisOp.setStyle(WSDLService.STYLE_DOC);
        service.addOperation(axisOp);
        UtilServer.deployService(service);

    }
View Full Code Here

        if(msgContext.getOperationContext() != null && msgContext.getServiceContext() != null){
            msgContext.setServiceGroupContextId(((ServiceGroupContext) msgContext.getServiceContext().getParent()).getId());
            return;
        }

        OperationDescription operationDesc = msgContext.getOperationDescription();

        //  1. look up opCtxt using mc.addressingHeaders.relatesTo[0]
        OperationContext operationContext = operationDesc.findForExistingOperationContext(msgContext);

        if (operationContext != null) {
            // register operation context and message context
            operationDesc.registerOperationContext(msgContext, operationContext);
            ServiceContext serviceContext = (ServiceContext) operationContext.getParent();
            ServiceGroupContext serviceGroupContext = (ServiceGroupContext) serviceContext.getParent();
            msgContext.setServiceContext(serviceContext);
            msgContext.setServiceGroupContext(serviceGroupContext);
            return;

        } else { //  2. if null, create new opCtxt
            operationContext =
                    OperationContextFactory.createOperationContext(operationDesc.getAxisSpecifMEPConstant(), operationDesc);
            operationDesc.registerOperationContext(msgContext, operationContext);

            //  fill the service group context and service context info
            msgContext.getSystemContext().
                    fillServiceContextAndServiceGroupContext(msgContext);
        }
View Full Code Here

            // find the WebService method
            Class ImplClass = obj.getClass();
            DependencyManager.configureBusinessLogicProvider(obj, msgContext, null);

            OperationDescription op = msgContext.getOperationContext()
                    .getAxisOperation();
            if (op == null) {
                throw new AxisFault(
                        "Operation is not located, if this is doclit style the SOAP-ACTION should specified via the SOAP Action to use the RawXMLProvider");
            }
            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

            Class ImplClass = obj.getClass();

            //Inject the Message Context if it is asked for
            DependencyManager.configureBusinessLogicProvider(obj, msgContext, newmsgContext);

            OperationDescription opDesc = msgContext.getOperationContext()
                    .getAxisOperation();
            Method method = findOperation(opDesc, ImplClass);
            if (method != null) {
                String style = msgContext.getOperationContext()
                        .getAxisOperation()
                        .getStyle();

                Class[] parameters = method.getParameterTypes();
                Object[] args = null;

                if (parameters == null || parameters.length == 0) {
                    args = new Object[0];
                } else if (parameters.length == 1) {
                    OMElement omElement = null;
                    if (WSDLService.STYLE_DOC.equals(style)) {
                        omElement =
                                msgContext.getEnvelope().getBody()
                                .getFirstElement();
                    } else if (WSDLService.STYLE_RPC.equals(style)) {
                        OMElement operationElement = msgContext.getEnvelope()
                                .getBody()
                                .getFirstElement();
                        if (operationElement != null) {
                            if (operationElement.getLocalName() != null &&
                                    operationElement.getLocalName().startsWith(
                                            method.getName())) {
                                omElement = operationElement.getFirstElement();
                            } else {
                                throw new AxisFault(Messages.getMessage("AandBdonotmatch","Operation Name","immediate child name",operationElement.getLocalName(),method.getName()));
                            }
                        } else {
                            throw new AxisFault(Messages.getMessage("rpcNeedmatchingChild"));
                        }
                    } else {
                        throw new AxisFault(Messages.getMessage("unknownStyle",style));
                    }
                    args = new Object[]{omElement};
                } else {
                    throw new AxisFault(Messages.getMessage("rawXmlProivdeIsLimited"));
                }

                OMElement result = (OMElement) method.invoke(obj, args);

                OMElement bodyContent = null;
                if (WSDLService.STYLE_RPC.equals(style)) {
                    OMNamespace ns = getSOAPFactory().createOMNamespace(
                            "http://soapenc/", "res");
                    bodyContent =
                            getSOAPFactory().createOMElement(
                                    method.getName() + "Response", ns);
                    bodyContent.addChild(result);
                } else {
                    bodyContent = result;
                }

                SOAPEnvelope envelope = getSOAPFactory().getDefaultEnvelope();
                if (bodyContent != null) {
                    envelope.getBody().addChild(bodyContent);
                }
                newmsgContext.setEnvelope(envelope);
            } else {
                throw new AxisFault(Messages.getMessage("methodNotImplemented",opDesc.getName().toString()));
            }
        } catch (Exception e) {
            throw AxisFault.makeFault(e);
        }
View Full Code Here

        super(clientHome);   
    }

    public SOAPEnvelope invokeBlockingWithEnvelopeOut(String axisop,
                                                      OMElement toSend) throws AxisFault {
        OperationDescription axisConfig =
                serviceContext.getServiceConfig().getOperation(new QName(axisop));
        if (axisConfig == null) {
            axisConfig = new OperationDescription(new QName(axisop));
            axisConfig.setRemainingPhasesInFlow(operationTemplate.getRemainingPhasesInFlow());
            axisConfig.setPhasesOutFlow(operationTemplate.getPhasesOutFlow());
            axisConfig.setPhasesInFaultFlow(operationTemplate.getPhasesInFaultFlow());
            axisConfig.setPhasesOutFaultFlow(operationTemplate.getPhasesOutFaultFlow());
            serviceContext.getServiceConfig().addOperation(axisConfig);
        }

//        if (axisConfig == null) {
//            axisConfig = new OperationDescription(new QName(axisop));
View Full Code Here

TOP

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

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.