Examples of WSIFPort


Examples of org.apache.wsif.WSIFPort

        "http://www.shoppingcart.com/definitions/ShoppingCartInterface",
        // portTypeNS,
        "ShoppingCart_JavaPortType" //  portTypeName
    );

        WSIFPort port = service.getPort();

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

        String customerNumber;
        String tempString;
        Address address;
        ShoppingCart_Java shoppingCart;
        Item item;
        CreditCardInfo creditCardInfo;
        AirMilesContainer airMilesContainer;
        Integer currentTotal = null;
        Long orderConfirmationNumber;
        Integer itemQuantity;
        Object part;
        boolean operationSucceeded;

        // -----------------------------------------------------------------------------------------------------
        operation = port.createOperation("createOperation");
        inputMessage = operation.createInputMessage();

        debug("\n---> Invocation: public ShoppingCart_Java(String firstName, String lastName, Address address, String customerNumber)");

        inputMessage.setObjectPart("firstName", "Albert");

        inputMessage.setObjectPart("lastName", "Einstein");

        address = new Address("Berlin", "Unter den Linden");
        inputMessage.setObjectPart("address", address);

        inputMessage.setObjectPart("customerNumber", "AE001");

        operation.executeInputOnlyOperation(inputMessage);

        // -----------------------------------------------------------------------------------------------------
        // First add something to the basket
        operation = port.createOperation("addItemOperation");
        inputMessage = operation.createInputMessage();
        outputMessage = operation.createOutputMessage();
        faultMessage = operation.createFaultMessage();

        debug("\n---> Invocation: public int addItem(String itemNumber, Item item, String itemName, int itemQuantity)");

        inputMessage.setObjectPart("itemNumber", "100123");

        item = new Item();
        inputMessage.setObjectPart("item", item);

        inputMessage.setObjectPart("itemName", "Pocket calculator");

        inputMessage.setIntPart("itemQuantity", 1);

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

        assertTrue("addItem test failed", operationSucceeded);

        if (operationSucceeded) {
          assertTrue(
                "addItemOperation (EJB) did not return an Item Object!!",
                outputMessage.getObjectPart("item") instanceof Item);
            debug(outputMessage.getObjectPart("item"));
            debug("Current total = " + outputMessage.getObjectPart("currentTotal"));
        } else {
            // Cannot get here since test would have already failed!
        }

        // -----------------------------------------------------------------------------------------------------
        // Test an "Input Only" operation by invoking the emptyBasket method
        operation = port.createOperation("emptyOrderOperation");
        inputMessage = operation.createInputMessage();

        debug("\n---> Invocation: public void emptyOrder(String customerNumber)");

        inputMessage.setObjectPart("customerNumber", "AE001");

        operation.executeInputOnlyOperation(inputMessage);

        // -----------------------------------------------------------------------------------------------------
        // Add to the basket again - the basket should be empty before this if previous operation worked!!
        operation = port.createOperation("addItemOperation");
        inputMessage = operation.createInputMessage();
        outputMessage = operation.createOutputMessage();
        faultMessage = operation.createFaultMessage();

        debug("\n---> Invocation: public int addItem(String itemNumber, Item item, String itemName, int itemQuantity)");
View Full Code Here

Examples of xsul.wsif.WSIFPort

        // This handler has to be end to get the entire soap message.
        NotificationHandler notificationHandler = new NotificationHandler(this.leadContext);
        this.client.addHandler(notificationHandler);

        WSIFPort port = this.client.getPort();
        if (this.operationName == null) {
            this.operationName = this.component.getOperationName();
        }
        logger.debug("operationName: " + operationName);
        this.operation = port.createOperation(operationName);
        this.inputMessage = this.operation.createInputMessage();
        this.outputMessage = this.operation.createOutputMessage();
        this.faultMessage = this.operation.createFaultMessage();
    }
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.