Package org.apache.wsif

Examples of org.apache.wsif.WSIFPort


            service.mapType(
                new javax.xml.namespace.QName(
                    "http://wsiftypes.addressbook/",
                    "phone"),
                Class.forName("addressbook.wsiftypes.Phone"));                   
            WSIFPort port = service.getPort(server+"Port");
            WSIFOperation op = port.createOperation("addEntry", "AddEntryWholeNameRequest", null);           
            doItPort(port, "WSIFPort_ApacheSOAP");
            WSIFOperation op2 = port.createOperation("addEntry", "AddEntryWholeNameRequest", null);
            WSIFMessage inputMessage = op2.createInputMessage();
            WSIFMessage outputMessage = op2.createOutputMessage();
            WSIFMessage faultMessage = op2.createFaultMessage();

            // Create a name and address to add to the addressbook
View Full Code Here


                factory.getService(wsdlLocation, null, // serviceNS
                null, // serviceName
                "http://wsifservice.simpletypes/", // portTypeNS
                "SimplePT"); // portTypeName

            WSIFPort port = service.getPort(portName);
     
      int i = 10;
      byte b = (byte) i;

            invokeOperation(port, "getString", "abcd");
View Full Code Here

                new javax.xml.namespace.QName(
                    "http://wsiftypes.addressbook/",
                    "phone"),
                Class.forName("addressbook.wsiftypes.Phone"));

            WSIFPort port = null;

            port = service.getPort(portName);

            WSIFOperation operation =
                port.createOperation("addEntry", "AddEntryWholeNameRequest", null);

            WSIFMessage inputMessage = operation.createInputMessage();
            WSIFMessage outputMessage = operation.createOutputMessage();
            WSIFMessage faultMessage = operation.createFaultMessage();

            // Create a name and address to add to the addressbook
            String nameToAdd = "Chris P. Bacon";

            // Add the name and leave out address to the input message
            inputMessage.setObjectPart("name", nameToAdd);
            //inputMessage.setObjectPart("address", null); // should default to null

            // Execute the operation, obtaining a flag to indicate its success
            boolean ok =
                operation.executeRequestResponseOperation(
                    inputMessage,
                    outputMessage,
                    faultMessage);

            assertTrue( "Failed to add name and address to addressbook", ok );

            // Start from fresh
            operation = null;
            inputMessage = null;
            outputMessage = null;
            faultMessage = null;

            operation = port.createOperation("getAddressFromName");

            // Create the messages
            inputMessage = operation.createInputMessage();
            outputMessage = operation.createOutputMessage();
            faultMessage = operation.createFaultMessage();
View Full Code Here

                        + "AddressBook.wsdl",
                    null,
                    null,
                    "http://wsifservice.addressbook/",
                    "AddressBook");
            WSIFPort port = service.getPort(server+"Port");
            WSIFOperation op = port.createOperation("addEntry", "AddEntryWholeNameRequest", null);           
            doItPort(port, "WSIFPort_ApacheAxis");            
        } catch (Exception e) {
            System.out.println(
                "\nAn error occured when running testWSIFPort_ApacheAxis " + e);
            assertTrue(false);
View Full Code Here

                        + "AddressBook.wsdl",
                    null,
                    null,
                    "http://wsifservice.addressbook/",
                    "AddressBook");
            WSIFPort port = service.getPort("NativeJmsPort");
            WSIFOperation op = port.createOperation("addEntry", "AddEntryWholeNameRequest", null);          
            doItPort(port, "WSIFPort_JMS");
        } catch (Exception e) {
            System.out.println(
                "\nAn error occured when running testWSIFPort_JMS " + e);
            assertTrue(false);
View Full Code Here

                        + "ShoppingCartAll.wsdl",
                    "http://www.shoppingcart.com/definitions/ShoppingCartInterface",
                    "ShoppingCart_JavaService",
                    "http://www.shoppingcart.com/definitions/ShoppingCartInterface",
                    "ShoppingCart_JavaPortType");
            WSIFPort port = service.getPort();
            WSIFOperation op = port.createOperation("addItemOperation");
            WSIFMessage message = op.createInputMessage();
            message.setObjectPart("testPart1", "test1");           
//            message.setObjectPart("testPart2", new StringTokenizer("test2"));           
            doItMessage(message);         
        } catch (Exception e) {
View Full Code Here

    }

    private WSIFPort doItPort(WSIFPort port, String portType) {

        try {
            WSIFPort p2 = (WSIFPort) writeItReadIt(port);
            assertNotNull(p2);
            System.out.println("\n" + portType + " was serialized and deserialized without problem");
            return p2;
        } catch (Exception e) {
            System.out.println("\nError testing port: " + portType + " :- " + e);
View Full Code Here

                new javax.xml.namespace.QName(
                    "http://wsiftypes.addressbook/",
                    "phone"),
                Class.forName("addressbook.wsiftypes.Phone"));

            WSIFPort port = service.getPort( portName );

            Address addr1 = new Address (1, "University Drive",
                                      "West Lafayette", "IN", 47907,
                                      new Phone (765, "494", "4900"));
            Address addr2 = new Address (0, "Somewhere Else",
View Full Code Here

            Service service = WSIFUtils.selectService(def, serviceNS, serviceName);
            PortType portType = WSIFUtils.selectPortType(def, portTypeNS, portTypeName);

            WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
            WSIFService dpf = factory.getService(def, service, portType);
            WSIFPort port = (portName == null) ? dpf.getPort() : dpf.getPort(portName);

            // 1st a call that should work
            WSIFOperation op1 = port.createOperation("getQuote", inputName, outputName);
            WSIFMessage input1 = op1.createInputMessage();
            WSIFMessage output1 = op1.createOutputMessage();
            WSIFMessage fault1 = op1.createFaultMessage();
            input1.setObjectPart("symbol", "");
            boolean ok = op1.executeRequestResponseOperation(input1, output1, fault1);

            assertEquals("ok getQuote response", true, ok);
            float q1 = ((Float) output1.getObjectPart("quote")).floatValue();
            assertEquals("getQuote value", -1.0F, q1, 0F);

            // now a call that is defined in WSDL but not on server
            op1 = port.createOperation("XXXgetQuote", inputName, outputName);
            input1 = op1.createInputMessage();
            output1 = op1.createOutputMessage();
            fault1 = op1.createFaultMessage();
            input1.setObjectPart("symbol", "");
            ok = op1.executeRequestResponseOperation(input1, output1, fault1);
View Full Code Here

                new javax.xml.namespace.QName(
                    "http://wsiftypes.addressbook/",
                    "phone"),
                Class.forName("addressbook.wsiftypes.Phone"));

            WSIFPort port = null;

            port = service.getPort(portName);
           
            /*
             * Run iterations of getPort
             */
            testName = testNamePrefix + ".getPort";
            iterations = (TEST_GETPORT)? getIterations( testName ) : 1;
            System.out.println( "running " + iterations + " " + testName + " iterations..." );
            for (int i = 0; i < iterations; i++ ) {
               Monitor.start( testName );
               port = service.getPort(portName);
               Monitor.stop( testName );
            }

            WSIFOperation operation =
                port.createOperation("addEntry", "AddEntryWholeNameRequest", null);

            WSIFMessage inputMessage = operation.createInputMessage();
            WSIFMessage outputMessage = operation.createOutputMessage();
            WSIFMessage faultMessage = operation.createFaultMessage();

            // Create a name and address to add to the addressbook
            String nameToAdd = "Chris P. Bacon";
            Address addressToAdd =
                new Address(
                    1,
                    "The Waterfront",
                    "Some City",
                    "NY",
                    47907,
                    new Phone(765, "494", "4900"));

            // Add the name and address to the input message
            inputMessage.setObjectPart("name", nameToAdd);
            inputMessage.setObjectPart("address", addressToAdd);

            // Execute the operation, obtaining a flag to indicate its success
            boolean ok=
                operation.executeRequestResponseOperation(
                    inputMessage,
                    outputMessage,
                    faultMessage);

            assertTrue( "failed to add name and address!!", ok );

            /*
             * Run iterations of createOperation
             */
            testName = testNamePrefix + ".createOperation";
            iterations = (TEST_CREATEOP)? getIterations( testName ) : 1;
            System.out.println( "running " + iterations + " " + testName + " iterations..." );
            for (int i = 0; i < iterations; i++ ) {
               Monitor.start( testName );
         operation = port.createOperation("getAddressFromName");
               Monitor.stop( testName );
            }

            /*
             * Run iterations of executeRequestResponseOperation
             */
            testName = testNamePrefix + ".executeOperation";
            iterations = (TEST_EXECOP)? getIterations( testName ) : 1;
            System.out.println( "running " + iterations + " " + testName + " iterations..." );
            for (int i = 0; i < iterations; i++ ) {
         operation = port.createOperation("getAddressFromName");
         inputMessage = operation.createInputMessage();
         outputMessage = operation.createOutputMessage();
         faultMessage = operation.createFaultMessage();

         inputMessage.setObjectPart("name", nameToAdd);
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.