Package org.apache.wsif

Examples of org.apache.wsif.WSIFPort


    public void testJava() throws Exception {
        WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
        WSIFService service = factory.getService(wsdl, null, null, null, null);

        WSIFPort port = service.getPort();

        WSIFOperation operation;
        WSIFMessage inputMessage;
        WSIFMessage outputMessage;
        WSIFMessage faultMessage;

        String tempString;

        Object part;
        boolean operationSucceeded;

        /**********************************************************
         * Test calling a service that takes a char as an argument
         **********************************************************/
        operation = port.createOperation("setCharOperation");
        inputMessage = operation.createInputMessage();
        outputMessage = operation.createOutputMessage();
        faultMessage = operation.createFaultMessage();

        inputMessage.setObjectPart("in", "a");

        operationSucceeded =
            operation.executeRequestResponseOperation(
                inputMessage,
                outputMessage,
                faultMessage);

        assertTrue("setChar failed!!", operationSucceeded);

        if (operationSucceeded) {
            assertTrue(
                "setChar did not return a boolean",
                outputMessage.getObjectPart("out") instanceof Boolean);
            assertTrue("setChar did not return true", ((Boolean) outputMessage.getObjectPart("out")).booleanValue());
            debug("setChar returned "+ outputMessage.getObjectPart("out"));
        } else {
      debug("operation failed");
        }

        /**********************************************************
         * Test calling a service that returns a char
         **********************************************************/
        operation = port.createOperation("getCharOperation");
        inputMessage = operation.createInputMessage();
        outputMessage = operation.createOutputMessage();
        faultMessage = operation.createFaultMessage();

        inputMessage.setBooleanPart("in", true);

        operationSucceeded =
            operation.executeRequestResponseOperation(
                inputMessage,
                outputMessage,
                faultMessage);

        assertTrue("getChar failed!!", operationSucceeded);

        if (operationSucceeded) {
            assertTrue(
                "getChar did not return a String",
                outputMessage.getObjectPart("out") instanceof String);
            debug("getChar returned "+ outputMessage.getObjectPart("out"));
        } else {
      debug("operation failed");
        }
       
        /*************************************************************
         * Test calling a service that takes a char[][] as an argument
         *************************************************************/
        operation = port.createOperation("setCharArrayOperation");
        inputMessage = operation.createInputMessage();
        outputMessage = operation.createOutputMessage();
        faultMessage = operation.createFaultMessage();

    String[][] sa = new String[][] {{"a", "b"},{"d", "e", "g"}};

        inputMessage.setObjectPart("in", sa);

        operationSucceeded =
            operation.executeRequestResponseOperation(
                inputMessage,
                outputMessage,
                faultMessage);

        assertTrue("setCharArray failed!!", operationSucceeded);

        if (operationSucceeded) {
            assertTrue(
                "setCharArray did not return a boolean",
                outputMessage.getObjectPart("out") instanceof Boolean);
            assertTrue("getCharArray did not return true", ((Boolean) outputMessage.getObjectPart("out")).booleanValue());               
            debug("setCharArray returned "+ outputMessage.getObjectPart("out"));
        } else {
      debug("operation failed");
        }
       
        /*************************************************************
         * Test calling a service that returns a char[][]
         *************************************************************/
        operation = port.createOperation("getCharArrayOperation");
        inputMessage = operation.createInputMessage();
        outputMessage = operation.createOutputMessage();
        faultMessage = operation.createFaultMessage();

    inputMessage.setBooleanPart("in", true);
View Full Code Here


     */
    public java.lang.String[] echoStringArray(
        java.lang.String[] argInputStringArray)
        throws WSIFException {

        WSIFPort port = this.svc.getPort();

        WSIFOperation operation =
            port.createOperation(
                "echoStringArray",
                "echoStringArrayRequest",
                "echoStringArrayResponse");

        WSIFMessage inputMessage = operation.createInputMessage();
        inputMessage.setName("echoStringArrayRequest");

        WSIFMessage outputMessage = operation.createOutputMessage();
        outputMessage.setName("echoStringArrayResponse");

        inputMessage.setObjectPart("inputStringArray", argInputStringArray);

        operation.executeRequestResponseOperation(inputMessage, outputMessage, null);

        port.close();

        return (java.lang.String[]) outputMessage.getObjectPart("return");

    }
View Full Code Here

     * echoInteger
     * @generated
     */
    public int echoInteger(int argInputInteger) throws WSIFException {

        WSIFPort port = this.svc.getPort();

        WSIFOperation operation =
            port.createOperation(
                "echoInteger",
                "echoIntegerRequest",
                "echoIntegerResponse");

        WSIFMessage inputMessage = operation.createInputMessage();
        inputMessage.setName("echoIntegerRequest");

        WSIFMessage outputMessage = operation.createOutputMessage();
        outputMessage.setName("echoIntegerResponse");

        inputMessage.setObjectPart(
            "inputInteger",
            new java.lang.Integer(argInputInteger));

        operation.executeRequestResponseOperation(inputMessage, outputMessage, null);

        port.close();

        return ((java.lang.Integer) outputMessage.getObjectPart("return")).intValue();

    }
View Full Code Here

     * @generated
     */
    public int[] echoIntegerArray(int[] argInputIntegerArray)
        throws WSIFException {

        WSIFPort port = this.svc.getPort();

        WSIFOperation operation =
            port.createOperation(
                "echoIntegerArray",
                "echoIntegerArrayRequest",
                "echoIntegerArrayResponse");

        WSIFMessage inputMessage = operation.createInputMessage();
        inputMessage.setName("echoIntegerArrayRequest");

        WSIFMessage outputMessage = operation.createOutputMessage();
        outputMessage.setName("echoIntegerArrayResponse");

        inputMessage.setObjectPart("inputIntegerArray", argInputIntegerArray);

        operation.executeRequestResponseOperation(inputMessage, outputMessage, null);

        port.close();

        return (int[]) outputMessage.getObjectPart("return");

    }
View Full Code Here

                    null,
                    null,
                    "http://jms/",
                    "JmsFault");

            WSIFPort port = service.getPort("default");
            WSIFOperation operation = port.createOperation(method);

            WSIFMessage inputMessage = operation.createInputMessage();
            inputMessage.setIntPart("choice",choice);
            WSIFMessage outputMessage = operation.createOutputMessage();
            WSIFMessage faultMessage = operation.createFaultMessage();
View Full Code Here

     * echoFloat
     * @generated
     */
    public float echoFloat(float argInputFloat) throws WSIFException {

        WSIFPort port = this.svc.getPort();

        WSIFOperation operation =
            port.createOperation("echoFloat", "echoFloatRequest", "echoFloatResponse");

        WSIFMessage inputMessage = operation.createInputMessage();
        inputMessage.setName("echoFloatRequest");

        WSIFMessage outputMessage = operation.createOutputMessage();
        outputMessage.setName("echoFloatResponse");

        inputMessage.setObjectPart("inputFloat", new java.lang.Float(argInputFloat));

        operation.executeRequestResponseOperation(inputMessage, outputMessage, null);

        port.close();

        return ((java.lang.Float) outputMessage.getObjectPart("return")).floatValue();

    }
View Full Code Here

     * @generated
     */
    public float[] echoFloatArray(float[] argInputFloatArray)
        throws WSIFException {

        WSIFPort port = this.svc.getPort();

        WSIFOperation operation =
            port.createOperation(
                "echoFloatArray",
                "echoFloatArrayRequest",
                "echoFloatArrayResponse");

        WSIFMessage inputMessage = operation.createInputMessage();
        inputMessage.setName("echoFloatArrayRequest");

        WSIFMessage outputMessage = operation.createOutputMessage();
        outputMessage.setName("echoFloatArrayResponse");

        inputMessage.setObjectPart("inputFloatArray", argInputFloatArray);

        operation.executeRequestResponseOperation(inputMessage, outputMessage, null);

        port.close();

        return (float[]) outputMessage.getObjectPart("return");

    }
View Full Code Here

     * echoVoid
     * @generated
     */
    public void echoVoid() throws WSIFException {

        WSIFPort port = this.svc.getPort();

        WSIFOperation operation =
            port.createOperation("echoVoid", "echoVoidRequest", "echoVoidResponse");

        WSIFMessage inputMessage = operation.createInputMessage();
        inputMessage.setName("echoVoidRequest");

        WSIFMessage outputMessage = operation.createOutputMessage();
        outputMessage.setName("echoVoidResponse");

        operation.executeRequestResponseOperation(inputMessage, outputMessage, null);

        port.close();

    }
View Full Code Here

     * echoBase64
     * @generated
     */
    public byte[] echoBase64(byte[] argInputBase64) throws WSIFException {

        WSIFPort port = this.svc.getPort();

        WSIFOperation operation =
            port.createOperation("echoBase64", "echoBase64Request", "echoBase64Response");

        WSIFMessage inputMessage = operation.createInputMessage();
        inputMessage.setName("echoBase64Request");

        WSIFMessage outputMessage = operation.createOutputMessage();
        outputMessage.setName("echoBase64Response");

        inputMessage.setObjectPart("inputBase64", argInputBase64);

        operation.executeRequestResponseOperation(inputMessage, outputMessage, null);

        port.close();

        return (byte[]) outputMessage.getObjectPart("return");

    }
View Full Code Here

     * @generated
     */
    public java.util.Date echoDate(java.util.Date argInputDate)
        throws WSIFException {

        WSIFPort port = this.svc.getPort();

        WSIFOperation operation =
            port.createOperation("echoDate", "echoDateRequest", "echoDateResponse");

        WSIFMessage inputMessage = operation.createInputMessage();
        inputMessage.setName("echoDateRequest");

        WSIFMessage outputMessage = operation.createOutputMessage();
        outputMessage.setName("echoDateResponse");

        inputMessage.setObjectPart("inputDate", argInputDate);

        operation.executeRequestResponseOperation(inputMessage, outputMessage, null);

        port.close();

        return (java.util.Date) outputMessage.getObjectPart("return");

    }
View Full Code Here

TOP

Related Classes of org.apache.wsif.WSIFPort

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.