Examples of InOutAxisOperation


Examples of org.apache.axis2.description.InOutAxisOperation

                        "function with the name (or a function containing the operationNmae " +
                        "annotation as) " + operationName + " already exists. ");
            }

            //We always assume that our operations are inout operations
            AxisOperation axisOperation = new InOutAxisOperation(new QName(operationName));

            Boolean safe = annotationParser.isSafe();
            if (safe != null) {
                Parameter safeParameter = new Parameter(WSDL2Constants.ATTR_WSDLX_SAFE, safe);
                axisOperation.addParameter(safeParameter);
            }

            String httpLocation = annotationParser.getHttpLocation();

            /*
            If the user did not specify a httpLocation default it to operationName
            cause this is the default that axis2 uses
            */
            if (httpLocation != null) {
                if (!httpLocation.startsWith("{{") && httpLocation.startsWith("{")) {
                    /*
                    We cannot extract parameters off the URL in situations such as
                    foo.httpLocation="{param}"; Rather it should be
                    foo.httpLocation="bar/{param}";
                    */
                    throw new DeploymentException(
                            "The httpLocation Annotation of operation " + operationName +
                                    " is invalid. The httpLocation found was \"" + httpLocation +
                                    "\". The httpLocation should not start with a parameter. " +
                                    "Please include a constant part at the start of the templete.");
                }
            } else {
                httpLocation = operationName;
            }

            String httpMethod = annotationParser.getHttpMethod();
            if (httpMethod == null) {
                /*
                If no httpMethod is specified we look for the safely annotation. If an operation
                is marked as safe then the httpMethod defaults to GET else its POST
                */
                if (safe != null && safe) {
                    httpMethod = HTTPConstants.HEADER_GET;
                } else {
                    httpMethod = HTTPConstants.HEADER_POST;
                }
            }

            /*
            Calculate the values for input and output actions according to
            http://www.w3.org/TR/ws-addr-wsdl/#defactionwsdl20
            */
            String inputAction = "urn:" + operationName;
            String outAction = "urn:" + operationName + Java2WSDLConstants.RESPONSE;
            axisOperation.setSoapAction(inputAction);
            axisOperation.setOutputAction(outAction);

            // Create a default SOAP 1.1 Binding operation
            AxisBindingOperation soap11BindingOperation =
                    createDefaultSOAP11BindingOperation(axisOperation, httpLocation, inputAction);

            // Create a default SOAP 1.2 Binding operation
            AxisBindingOperation soap12BindingOperation =
                    createDefaultSOAP12BindingOperation(axisOperation, httpLocation, inputAction);

            // Create a default HTTP Binding operation
            AxisBindingOperation httpBindingOperation =
                    createDefaultHTTPBindingOperation(axisOperation, httpLocation, httpMethod,
                            annotationParser.isIgnoreUncited());

            /*
            We need to extract a constant value from the httpLocation so that the
            httpLocationBasedDispatcher can use that value to dispatch to the correct operation
            */
            String httpLocationString =
                    WSDLUtil.getConstantFromHTTPLocation(httpLocation, httpMethod);
            httpLocationTable.put(httpLocationString, axisOperation);

            /*
            set the org.wso2.carbon.mashup.javascript.messagereceiver.JavaScriptReceiver as the
            MessageReceiver for this operation
            */
            axisOperation.setMessageReceiver(new JavaScriptReceiver());
            axisOperation.setStyle(WSDLConstants.STYLE_DOC);
            axisOperation.setDocumentation(annotationParser.getDocumentation());

            /*
            This is needed in case the user used the "operationName" annoatation. for e.g if the
            following was used, the WSDL will show bar but when a request come in we should be
            executing foo instead.

            foo.operationName="bar";
            function foo () {};
            */
            Parameter jsFunctionNameParamter =
                    new Parameter(MashupConstants.JS_FUNCTION_NAME, originalMethodName);
            axisOperation.addParameter(jsFunctionNameParamter);

            String[] params = extractInputParameters(engine, originalMethodName);

            // Create the in and out axis messages for this operation
            AxisMessage inMessage = axisOperation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);

            if (inMessage != null) {
                Object inputTypes = annotationParser.getInputTypesNameObject();
                inMessage.setName(method + Java2WSDLConstants.MESSAGE_SUFFIX);
                createAxisBindingMessage(soap11BindingOperation, inMessage,
                        WSDLConstants.MESSAGE_LABEL_IN_VALUE);
                createAxisBindingMessage(soap12BindingOperation, inMessage,
                        WSDLConstants.MESSAGE_LABEL_IN_VALUE);
                createAxisBindingMessage(httpBindingOperation, inMessage,
                        WSDLConstants.MESSAGE_LABEL_IN_VALUE);

                /*
                Generate the input element for the input message using the "inputTypes'
                annotation specified by the user
                */
                XmlSchemaElement element = schemaGenerator
                        .createInputElement(inMessage, inputTypes, operationName, params, method);
                if (element != null) {
                    inMessage.setElementQName(new QName(schemaTargetNamespace, element.getName()));
                }
            }

            AxisMessage outMessage =
                    axisOperation.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
            Object outputType = annotationParser.getOutputTypeNameObject();
            //we always assume return parameter as "return"
            params = new String[]{"return"};

            if (outMessage != null) {
View Full Code Here

Examples of org.apache.axis2.description.InOutAxisOperation

        org.apache.axis2.context.MessageContext axis2MC
                = new org.apache.axis2.context.MessageContext();
        axis2MC.setConfigurationContext(this.configContext);

        ServiceContext svcCtx = new ServiceContext();
        OperationContext opCtx = new OperationContext(new InOutAxisOperation(), svcCtx);
        axis2MC.setServiceContext(svcCtx);
        axis2MC.setOperationContext(opCtx);
        MessageContext mc = new Axis2MessageContext(axis2MC, synapseConfig, this);
        mc.setMessageID(UIDGenerator.generateURNString());
        try {
View Full Code Here

Examples of org.apache.axis2.description.InOutAxisOperation

    }

    public static void createOperation(AxisService axisService, String name, MessageReceiver messageReceiver,
            String inputAction, String outputAction) {
        InOutAxisOperation operation1 = new InOutAxisOperation(new QName(name));
        operation1.setMessageReceiver(messageReceiver);
        operation1.setOutputAction(outputAction);
        axisService.addOperation(operation1);
        if (inputAction != null) {
            axisService.mapActionToOperation(inputAction, operation1);
        }
    }
View Full Code Here

Examples of org.apache.axis2.description.InOutAxisOperation

    }

    public static void createOperation(AxisService axisService, String name, MessageReceiver messageReceiver,
            String inputAction, String outputAction) {
        InOutAxisOperation operation1 = new InOutAxisOperation(new QName(name));
        operation1.setMessageReceiver(messageReceiver);
        operation1.setOutputAction(outputAction);
        axisService.addOperation(operation1);
        if (inputAction != null) {
            axisService.mapActionToOperation(inputAction, operation1);
        }
    }
View Full Code Here

Examples of org.apache.axis2.description.InOutAxisOperation

    }

    public static void createOperation(AxisService axisService, String name, MessageReceiver messageReceiver,
            String inputAction, String outputAction) {
        InOutAxisOperation operation1 = new InOutAxisOperation(new QName(name));
        operation1.setMessageReceiver(messageReceiver);
        operation1.setOutputAction(outputAction);
        axisService.addOperation(operation1);
        if (inputAction != null) {
            axisService.mapActionToOperation(inputAction, operation1);
        }
    }
View Full Code Here

Examples of org.apache.axis2.description.InOutAxisOperation

        TransportOutDescription transport = new TransportOutDescription("null");
        transport.setSender(new CommonsHTTPTransportSender());

        TransportInDescription transportIn = new TransportInDescription("null");
        AxisOperation axisOp = new InOutAxisOperation(operationName);

        AxisService service = new AxisService(serviceName.getLocalPart());
        axisOp.setMessageReceiver(new MessageReceiver() {
            public void receive(MessageContext messageCtx) throws AxisFault {
                // TODO Auto-generated method stub

            }
        });
View Full Code Here

Examples of org.apache.axis2.description.InOutAxisOperation

        axisSrvGrp_ABC.addService(axisSrv_A);
        axisSrvGrp_ABC.addService(axisSrv_B);
        axisSrvGrp_ABC.addService(axisSrv_C);

        axisOp_A1 = new InOutAxisOperation(operation_QName_A1);
        axisOp_A2 = new InOutAxisOperation(operation_QName_A2);

        axisOp_A1.setMessageReceiver(new MessageReceiver() {
            public void receive(MessageContext messageCtx) {
            }
        });

        axisOp_A2.setMessageReceiver(new MessageReceiver() {
            public void receive(MessageContext messageCtx) {
            }
        });

        axisSrv_A.addOperation(axisOp_A1);
        axisSrv_A.mapActionToOperation(operation_QName_A1.getLocalPart(), axisOp_A1);

        axisSrv_A.addOperation(axisOp_A2);
        axisSrv_A.mapActionToOperation(operation_QName_A2.getLocalPart(), axisOp_A2);

        axisConfiguration.addService(axisSrv_A);
        axisConfiguration.addService(axisSrv_B);
        axisConfiguration.addService(axisSrv_C);


        axisOp_A1.getRemainingPhasesInFlow().add(phase1);
        axisOp_A2.getRemainingPhasesInFlow().add(phase1);

        //----------------------------
        // 123 group
        //----------------------------
        axisSrvGrp_123 = new AxisServiceGroup(axisConfiguration);
        axisSrvGrp_123.setServiceGroupName(serviceGroupName_123);

        axisSrv_1 = new AxisService(service_QName_1.getLocalPart());
        axisSrv_2 = new AxisService(service_QName_2.getLocalPart());
        axisSrv_3 = new AxisService(service_QName_3.getLocalPart());
        axisSrv_4 = new AxisService(service_QName_4.getLocalPart());

        axisSrvGrp_123.addService(axisSrv_1);
        axisSrvGrp_123.addService(axisSrv_2);
        axisSrvGrp_123.addService(axisSrv_3);
        axisSrvGrp_123.addService(axisSrv_4);

        axisOp_1_1 = new InOutAxisOperation(operation_QName_1_1);
        axisOp_1_2 = new InOutAxisOperation(operation_QName_1_2);

        axisOp_1_1.setMessageReceiver(new MessageReceiver() {
            public void receive(MessageContext messageCtx) {
            }
        });

        axisOp_1_2.setMessageReceiver(new MessageReceiver() {
            public void receive(MessageContext messageCtx) {
            }
        });

        axisSrv_1.addOperation(axisOp_1_1);
        axisSrv_1.mapActionToOperation(operation_QName_1_1.getLocalPart(), axisOp_1_1);

        axisSrv_1.addOperation(axisOp_1_2);
        axisSrv_1.mapActionToOperation(operation_QName_1_2.getLocalPart(), axisOp_1_2);

        axisConfiguration.addService(axisSrv_1);
        axisConfiguration.addService(axisSrv_2);
        axisConfiguration.addService(axisSrv_3);
        axisConfiguration.addService(axisSrv_4);

        axisOp_1_1.getRemainingPhasesInFlow().add(phase1);
        axisOp_1_2.getRemainingPhasesInFlow().add(phase1);

        //----------------------------
        // DAY group
        //----------------------------
        axisSrvGrp_DAY = new AxisServiceGroup(axisConfiguration);
        axisSrvGrp_DAY.setServiceGroupName(serviceGroupName_DAY);

        axisSrv_Mon = new AxisService(service_QName_Mon.getLocalPart());
        axisSrv_Tue = new AxisService(service_QName_Tue.getLocalPart());
        axisSrv_Wed = new AxisService(service_QName_Wed.getLocalPart());
        axisSrv_Thu = new AxisService(service_QName_Thu.getLocalPart());
        axisSrv_Fri = new AxisService(service_QName_Fri.getLocalPart());

        axisSrvGrp_DAY.addService(axisSrv_Mon);
        axisSrvGrp_DAY.addService(axisSrv_Tue);
        axisSrvGrp_DAY.addService(axisSrv_Wed);
        axisSrvGrp_DAY.addService(axisSrv_Thu);
        axisSrvGrp_DAY.addService(axisSrv_Fri);

        axisOp_Mon_1 = new InOutAxisOperation(operation_QName_Mon_1);
        axisOp_Mon_2 = new InOutAxisOperation(operation_QName_Mon_2);

        axisOp_Mon_1.setMessageReceiver(new MessageReceiver() {
            public void receive(MessageContext messageCtx) {
            }
        });
View Full Code Here

Examples of org.apache.axis2.description.InOutAxisOperation

                AbstractTestCase.basedir + "/test-resources/deployment/moduleDisEngegeRepo";
        config = ConfigurationContextFactory.
                createConfigurationContextFromFileSystem(filename, null).getAxisConfiguration();
        AxisService testService = new AxisService();
        testService.setName(serviceName);
        AxisOperation testOperation = new InOutAxisOperation();
        testOperation.setName(opName);
        testService.addOperation(testOperation);

        testOperation = new InOutAxisOperation();
        testOperation.setName(new QName("oper2"));
        testService.addOperation(testOperation);
       
        config.addService(testService);
    }
View Full Code Here

Examples of org.apache.axis2.description.InOutAxisOperation

        axisService = new AxisService(serviceName.getLocalPart());
        axisServiceGroup.addService(axisService);


        axisOperation = new InOutAxisOperation(operationName);
        axisOperation.setMessageReceiver(new MessageReceiver() {
            public void receive(MessageContext messageCtx) {

            }
        });
View Full Code Here

Examples of org.apache.axis2.description.InOutAxisOperation

        axisService = new AxisService(serviceName.getLocalPart());
        axisServiceGroup.addService(axisService);


        axisOperation = new InOutAxisOperation(operationName);
        axisOperation.setMessageReceiver(new MessageReceiver() {
            public void receive(MessageContext messageCtx) {

            }
        });
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.