Package org.apache.wsif

Examples of org.apache.wsif.WSIFService


        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);

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

            WSIFMessage inputMessage = operation.createInputMessage();
View Full Code Here


            Service service = WSIFUtils.selectService(def, null, null);
            PortType portType = WSIFUtils.selectPortType(def, null, null);
            // Step 2: identify the operation (choose an
            // appropriate service port)
            WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
            WSIFService wsifService = factory.getService(def, service, portType);
            // Get default port
            String portName = "JavaPort";
            WSIFPort port = wsifService.getPort(portName);
            // WSIFPort was created correctly, so Java binding was registered
            assertTrue("WSIFPort was created correctly", true);
        } catch (Exception e) {
            assertTrue("Couldn't create JavaPort so bindings not registered false", false);
        }
View Full Code Here

    TestUtilities.setProviderForProtocol( protocol );

    System.out.println("\n=== StockQuote");
    try {
      WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
        WSIFService service = factory.getService( WSDL_LOCATION,
          null, // serviceNS
        null, // serviceName
            "http://wsifservice.stockquote/", // portTypeNS
        "StockquotePT" ); // portTypeName

      port = service.getPort(portName);

      // Executing executeRequestResponseAsync(input)
      operation = port.createOperation( "getQuote" );

      context = operation.getContext();
View Full Code Here

            // create a service factory
            WSIFServiceFactory factory = WSIFServiceFactory.newInstance();

            // parse WSDL
            WSIFService service =
                factory.getService(
                    args[0],
                    null,
                    null,
                    "http://www.themindelectric.com/wsdl/net.xmethods.services.stockquote.StockQuote/",
                    "net.xmethods.services.stockquote.StockQuotePortType");
            // create the stub
            NetXmethodsServicesStockquoteStockQuotePortType stub =
                    (NetXmethodsServicesStockquoteStockQuotePortType) service.getStub(
                        NetXmethodsServicesStockquoteStockQuotePortType.class);

            // do the invocation
            // args[1] is the company symbol
            float quote = stub.getQuote(args[1]);
View Full Code Here

    private void doit(String portName, String protocol) {
      TestUtilities.setProviderForProtocol( protocol );

        try {
            WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
            WSIFService service =
                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

        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);

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

            WSIFMessage inputMessage = operation.createInputMessage();
View Full Code Here

    public void testWSIFPort_Java() {
        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");           
            doItPort(port, "WSIFPort_Java");         
        } catch (Exception e) {
            System.out.println(
                "\nAn error occured when running testWSIFPort_Java " + e);              
View Full Code Here

    public void testWSIFPort_EJB() {
      if (!TestUtilities.areWeTesting("ejb")) return;
        try {
            // TEST EJB
            WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
            WSIFService service =
                factory.getService(
                    TestUtilities.getWsdlPath("java\\test\\shop")
                        + "ShoppingCartAll.wsdl",
                    "http://www.shoppingcart.com/definitions/ShoppingCartInterface",
                    "ShoppingCart_EJBService",
                    "http://www.shoppingcart.com/definitions/ShoppingCartInterface",
                    "ShoppingCart_EJBPortType");
            WSIFPort port = service.getPort();
            //WSIFOperation op = port.createOperation("addItemOperation");
            doItPort(port, "WSIFPort_EJB");         
        } catch (Exception e) {
            System.out.println(
                "\nAn error occured when running testWSIFPort_EJB " + e);
View Full Code Here

    public void testWSIFPort_ApacheSOAP() {
        try {
            // TEST APACHE SOAP
            TestUtilities.setProviderForProtocol("soap");
            WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
            WSIFService service =
                factory.getService(
                    TestUtilities.getWsdlPath(
                        "java\\test\\addressbook\\wsifservice")
                        + "AddressBook.wsdl",
                    null,
                    null,
                    "http://wsifservice.addressbook/",
                    "AddressBook");
            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(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();
View Full Code Here

    public void testWSIFPort_ApacheAxis() {
        try {
            // TEST APACHE AXIS
            TestUtilities.setProviderForProtocol("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(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);
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.