Package org.apache.wsif

Examples of org.apache.wsif.WSIFService


    public void testWSIFPort_JMS() {
      if (!TestUtilities.areWeTesting("jms")) return;
        try {
            // TEST APACHE AXIS
            WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
            WSIFService service =
                factory.getService(
                    TestUtilities.getWsdlPath(
                        "java\\test\\addressbook\\wsifservice")
                        + "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);
View Full Code Here


    public void testWSIFMessage() {
        try {
            // TEST JAVA
            WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
            WSIFService service =
                factory.getService(
                    TestUtilities.getWsdlPath("java\\test\\shop")
                        + "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);         
View Full Code Here

        System.out.println(
           "\n=== " + this.getClass().getName() + " " + portName + " " + protocol );

        try {
            WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
                WSIFService service = factory.getService(WSDL_LOCATION,
                null, // serviceNS
                null, // serviceName
                "http://wsifservice.addressbook/", // portTypeNS
                "AddressBook"); // portTypeName

            service.mapType(
                new javax.xml.namespace.QName(
                    "http://wsiftypes.addressbook/",
                    "address"),
                Class.forName("addressbook.wsiftypes.Address"));

            service.mapType(
                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

        String portName = "";
        try {
            InitialContext ic = new InitialContext();

            // Lookup jndi service name       
            WSIFService service = (WSIFService) ic.lookup("comp/env/wsif/addressservice");

            Iterator it = service.getAvailablePortNames();
            {
                System.out.println("What ports does this service have?");
                while (it.hasNext()) {
                    String p = (String) it.next();
                    portName = p;
                    System.out.print("Port found named " + p);
                    if (p.toUpperCase().indexOf("JMS") >= 0
                        && !TestUtilities.areWeTesting("jms")) {
                        System.out.println(
                            " - Port is a JMS port and I don't like JMS so I refuse to use it!");
                    } else {
                        if (("SOAPPort".equals(p) || "AXISPort".equals(p))
                            && !p.equals(server + "Port"))
                        {
                            System.out.println(
                                "- not configured to use " + server + " port ");
                            continue;
                        }
                       
                        System.out.println(" - I like this port, I think I'll use it!");
                        AddressBook abStub = (AddressBook) service.getStub(p, AddressBook.class);

                        abStub.addEntry(name1, addr1);
                        abStub.addEntry(firstName2, lastName2, addr2);

                        Address resp1 = abStub.getAddressFromName(name1);
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();
View Full Code Here

        TestUtilities.setProviderForProtocol( protocol );

        try {
            WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
            WSIFService service =
                factory.getService(
                    wsdlLocation,
                    null,
                    null,
                    "http://wsifservice.stockquote/",
                    "StockquotePT");

            System.err.println("\n\nUsing '" + portName + "' port:");
            StockquotePT stub =
                (StockquotePT) service.getStub(portName, StockquotePT.class);

            float quote = stub.getQuote("");
            System.err.println(">> Received quote " + quote + " for ''");
            assertTrue(quote == -1.0F);
View Full Code Here

        TestUtilities.setProviderForProtocol( protocol );

        try {
            WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
            WSIFService service = factory.getService(wsdlLocation, null, // serviceNS
               null, // serviceName
               "http://wsifservice.addressbook/", // portTypeNS
               "AddressBook"); // portTypeName

            service.mapType(
                new javax.xml.namespace.QName(
                    "http://wsiftypes.addressbook/",
                    "address"),
                Class.forName("addressbook.wsiftypes.Address"));

            service.mapType(
                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);
View Full Code Here

           String serviceAvailabilityWSDL) throws Exception {
  // create a service factory
  WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
  // initialize the address book stub
  // parse the WSDL
  WSIFService service =
      factory.getService(addressbookWSDL,null,null,
             "http://wsifservice.addressbook/",
             "AddressBook");
  // create the stub
  addressBook = (AddressBook) service.getStub(AddressBook.class);
  // initialize the zip2geo stub
  // parse the WSDL
  service = factory.getService(zip2geoWSDL,null,null,"http://ws.cdyne.com",
             "Zip2GeoSoap");
  // map types
  service.mapType(new QName("http://ws.cdyne.com", "LatLongReturn"),
      Class.forName("complexsoap.client.stub.com.cdyne.ws.LatLongReturn"));
  // create the stub
  zip2geo = (Zip2GeoSoap) service.getStub(Zip2GeoSoap.class);
  // initialize the service availability stub
  // parse the WSDL
  service = factory.getService(serviceAvailabilityWSDL,null,null,
             "http://xml.apache.org/axis/wsif/samples/jms/ServiceAvailability",
             "CheckAvailabilityPortType");
  // create the stub
  serviceAvailability =
      (CheckAvailabilityPortType) service.getStub(CheckAvailabilityPortType.class);
    }
View Full Code Here

            System.exit(1);
        }
       
        // create a service factory
        WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
        WSIFService service =
            factory.getService(
                args[0],
                null,
                null,
                "http://ws.cdyne.com",
                "Zip2GeoSoap");

        // map types
        service.mapType(
            new QName("http://ws.cdyne.com", "LatLongReturn"),
            Class.forName(
                "complexsoap.client.stub.com.cdyne.ws.LatLongReturn"));

        // get the port
        WSIFPort port = service.getPort();

        // create the operation
        WSIFOperation operation = port.createOperation("GetLatLong");

        // create the input, output and fault messages associated with this operation
View Full Code Here

          throw new UEngineException("Couldn't get the endpoint to invoke WS",e);
        }

        WSIFServiceFactory factory = WSIFServiceFactory.newInstance();

        WSIFService service = factory.getService(wsdlUrl, null, null,endpoint, null);

        WSIFPort port = service.getPort();

        WSIFOperation operation = port.createOperation(getOperationName());

        WSIFMessage input = operation.createInputMessage();
        WSIFMessage output = operation.createOutputMessage();
View Full Code Here

TOP

Related Classes of org.apache.wsif.WSIFService

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.