Examples of WSIFOperation


Examples of com.volantis.wsif.WSIFOperation

                wsdlInput.getName();
        Output wsdlOutput = wsdlOperation.getOutput();
        String outputName = (wsdlOutput.getName() == null) ? null :
                wsdlOutput.getName();

        WSIFOperation wsifOperation =
                wsifPort.createOperation(operationName, inputName, outputName);
        WSIFMessage input = wsifOperation.createInputMessage();
        WSIFMessage output = wsifOperation.createOutputMessage();
        WSIFMessage fault = wsifOperation.createFaultMessage();

        initializeInputParts(wsdlInput.getMessage(), message, input);

        createTypeMappings(input, output, wsifService, wsifOperation);

        try {
            wsifOperation.executeRequestResponseOperation(
                    input, output, fault);
        } catch (IOException e) {
            throw new WSIFException(e.getMessage(), e);
        }
View Full Code Here

Examples of org.apache.wsif.WSIFOperation

     * @see org.apache.wsif.base.WSIFDefaultPort#createOperation(java.lang.String)
     */
    public WSIFOperation createOperation( String operationName ) throws WSIFException
    {
        Trc.entry( this, operationName );
        WSIFOperation wo = createOperation( operationName, null, null );
        Trc.exit( wo );
        return wo;
    }
View Full Code Here

Examples of org.apache.wsif.WSIFOperation

        if ( op == null )
        {
            throw new WSIFException( "Could not create operation: " + operationName + ':' + inputName + ':'
                    + outputName );
        }
        WSIFOperation wo = op.copy();
        Trc.exit( wo );
        return wo;
    }
View Full Code Here

Examples of org.apache.wsif.WSIFOperation

    }

    private Object invokeOperation( WSIFPort port, String name, Object partVal ) throws Exception
    {
        Object result = null;
        WSIFOperation operation = port.createOperation( name );

        WSIFMessage inputMessage = operation.createInputMessage();
        WSIFMessage outputMessage = operation.createOutputMessage();
        WSIFMessage faultMessage = operation.createFaultMessage();
        inputMessage.setObjectPart( "dummy", partVal );

        assertTrue( operation.executeRequestResponseOperation( inputMessage, outputMessage, faultMessage ) );

        result = outputMessage.getObjectPart( "return" );
        assertNotNull( result );

        return result;
View Full Code Here

Examples of org.apache.wsif.WSIFOperation

        {
            // create the operation
            // note that we have two operations with the same name, so we need
            // to specify the
            // name of the input and output messages as well
            WSIFOperation operation = port.createOperation( "addEntry", "AddEntryFirstAndLastNamesRequest", null );

            assertNotNull( operation );

            // create the input message associated with this operation
            WSIFMessage input = operation.createInputMessage();

            // populate the input message
            input.setObjectPart( "firstName", "John" );
            input.setObjectPart( "lastName", "Smith" );

            // create an address object to populate the input
            Address address = new Address();
            address.setStreetNum( 20 );
            address.setStreetName( "Peachtree Avenue" );
            address.setCity( "Atlanta" );
            address.setState( "GA" );
            address.setZip( 39892 );
            Phone phone = new Phone();
            phone.setAreaCode( 701 );
            phone.setExchange( "555" );
            phone.setNumber( "8721" );
            address.setPhoneNumber( phone );

            input.setObjectPart( "address", address );

            // do the invocation
            System.out.println( "Adding address for John Smith..." );
            operation.executeInputOnlyOperation( input );

        }
        catch ( WSIFException we )
        {
            System.out.println( "Got exception from WSIF, details:" );
View Full Code Here

Examples of org.apache.wsif.WSIFOperation

    public void testQueryAddresses()
    {
        try
        {
            // create the operation
            WSIFOperation operation = port.createOperation( "getAddressFromName" );

            assertNotNull( operation );

            // create the input message associated with this operation
            WSIFMessage input = operation.createInputMessage();
            WSIFMessage output = operation.createOutputMessage();
            WSIFMessage fault = operation.createFaultMessage();

            // populate the input message
            input.setObjectPart( "name", "John Smith" );

            // do the invocation
            System.out.println( "Querying address for John Smith..." );
            if ( operation.executeRequestResponseOperation( input, output, fault ) )
            {
                // invocation succeeded
                // extract the address from the output message
                Address address = (Address) output.getObjectPart( "address" );
                assertNotNull( address );
View Full Code Here

Examples of org.apache.wsif.WSIFOperation

        try {
            // create the operation
            // note that we have two operations with the same name,
            // so we need to specify the name of the input and output
            // messages as well
            WSIFOperation operation =
                port.createOperation(
                    "addEntry",
                    "AddEntryWholeNameRequest",
                    null);
                   
            // create the input message associated with this operation
            WSIFMessage input = operation.createInputMessage();

            // populate the input message
            input.setObjectPart("name", "John Smith");

            // create an address object to populate the input
            Address address = new Address();
            address.setStreetNum(25);
            address.setStreetName("Willow Road");
            address.setCity("MyTown");
            address.setState("PA");
            address.setZip(28382);
            Phone phone = new Phone();
            phone.setAreaCode(288);
            phone.setExchange("555");
            phone.setNumber("9891");
            address.setPhoneNumber(phone);

            input.setObjectPart("address", address);

            // do the invocation
            System.out.println("Adding address for John Smith...");
            operation.executeInputOnlyOperation(input);

        } catch (WSIFException we) {
            System.out.println("Got exception from WSIF, details:");
            we.printStackTrace();
        }
View Full Code Here

Examples of org.apache.wsif.WSIFOperation

        try {

            // create the operation
            // note that we have two operations with the same name, so we need to specify the
            // name of the input and output messages as well
            WSIFOperation operation =
                port.createOperation(
                    "addEntry",
                    "AddEntryFirstAndLastNamesRequest",
                    null);

            // create the input message associated with this operation
            WSIFMessage input = operation.createInputMessage();

            // populate the input message
            input.setObjectPart("firstName", "Jane");
            input.setObjectPart("lastName", "White");

            // create an address object to populate the input
            Address address = new Address();
            address.setStreetNum(20);
            address.setStreetName("Peachtree Avenue");
            address.setCity("Atlanta");
            address.setState("GA");
            address.setZip(39892);
            Phone phone = new Phone();
            phone.setAreaCode(701);
            phone.setExchange("555");
            phone.setNumber("8721");
            address.setPhoneNumber(phone);

            input.setObjectPart("address", address);

            // do the invocation
            System.out.println("Adding address for Jane White...");
            operation.executeInputOnlyOperation(input);

        } catch (WSIFException we) {
            System.out.println("Got exception from WSIF, details:");
            we.printStackTrace();
        }
View Full Code Here

Examples of org.apache.wsif.WSIFOperation

    }

    private static void queryAddresses(WSIFPort port) {
        try {
            // create the operation
            WSIFOperation operation =
                port.createOperation("getAddressFromName");

            // create the input message associated with this operation
            WSIFMessage input = operation.createInputMessage();
            WSIFMessage output = operation.createOutputMessage();
            WSIFMessage fault = operation.createFaultMessage();

            // populate the input message
            input.setObjectPart("name", "John Smith");

            // do the invocation
            System.out.println("Querying address for John Smith...");
            if (operation.executeRequestResponseOperation(input, output, fault)) {
                // invocation succeeded
                // extract the address from the output message
                Address address = (Address) output.getObjectPart("address");
                System.out.println("Service returned the following address:");
                System.out.println(
                    address.getStreetNum()
                        + " "
                        + address.getStreetName()
                        + ", "
                        + address.getCity()
                        + " "
                        + address.getState()
                        + " "
                        + address.getZip()
                        + "; Phone: ("
                        + address.getPhoneNumber().getAreaCode()
                        + ") "
                        + address.getPhoneNumber().getExchange()
                        + "-"
                        + address.getPhoneNumber().getNumber());
            } else {
                // invocation failed, check fault message
            }
            // create the operation
            operation = port.createOperation("getAddressFromName");
            // create the input message associated with this operation
            input = operation.createInputMessage();
            output = operation.createOutputMessage();
            fault = operation.createFaultMessage();
            // populate the input message
            input.setObjectPart("name", "Jane White");
            // do the invocation
            System.out.println("Querying address for Jane White...");
            if (operation.executeRequestResponseOperation(input, output, fault)) {
                // invocation succeeded
                // extract the address from the output message
                Address address = (Address) output.getObjectPart("address");
                System.out.println("Service returned the following address:");
                System.out.println(
View Full Code Here

Examples of org.apache.wsif.WSIFOperation

    }

    protected void addBindingOperation(Binding binding, BindingOperation bindingOperation) throws WSIFException {
        Operation operation = bindingOperation.getOperation();
        String name = operation.getName();
        WSIFOperation wsifOperation = service.getPort().createOperation(name);

        WSIFOperationInfo info = new WSIFOperationInfo(wsifOperation, bindingOperation);

        operationMap.put(name, info);
        operationMap.put(new QName(name), info);
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.