Package org.apache.wsif

Examples of org.apache.wsif.WSIFPort


      Class.forName("ejb.service.addressbook.wsiftypes.Address"));
  service.mapType(new QName("http://wsiftypes.addressbook/","Phone"),
      Class.forName("ejb.service.addressbook.wsiftypes.Phone"));

  // get the port
  WSIFPort port = service.getPort();
  // add the first address
  addFirstAddress(port);
  // add the second address
  addSecondAddress(port);
  // query addresses
View Full Code Here


                        + " no alternative can be found");
            }
        }

        portName = port.getName();
        WSIFPort portInstance = createDynamicWSIFPort(def, service, port);
        if (portInstance == null) {
            throw new WSIFException(
                "Provider was unable to create WSIFPort for port " + portName);
        }
        // Store the chosen port so that we can query which was is being used
View Full Code Here

            typeMapInitialised = true;
        }

        // if the port is not available, force the expection now rather
        // rather than go through the rest of this method   
        WSIFPort wsifPort = getPort(portName);

        // If we've got to this line then the port must be available
        PortType pt = getPortTypeFromPortName(portName);

        // If the user has already created a proxy for this interface before
View Full Code Here

            typeMapInitialised = true;
        }

        // if the port is not available, force the expection now rather
        // rather than go through the rest of this method   
        WSIFPort wsifPort = getPort();

        // Chosen port has been stored so use it to find portType
        String portName = chosenPort.getName();
        PortType pt = getPortTypeFromPortName(portName);
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";
            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
            operation.executeInputOnlyOperation(inputMessage);

            // 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

        }
    }

    private void testAsyncOPs(WSIFService service, String portName, String name, Address addr) {
       try {
            WSIFPort port =
                (portName == null) ? service.getPort() : service.getPort(portName);

            if (!port.supportsAsync() ) {
              return;
            }   

            WSIFOperation op = port.createOperation( "getAddressFromName" );
           
            AsyncResponseHandler abHandler = new AsyncResponseHandler( 1 ); // 1 async call

            WSIFMessage inMsg = op.createInputMessage();
            inMsg.setObjectPart( "name", name );
View Full Code Here

            // 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

  /**
   * Query Stockquote sample
   */
  public void doitStockquote(String portName, String protocol, String fakeFile, String error) {
    float value;
    WSIFPort port;
    WSIFOperation operation;
    WSIFMessage input, output, fault, context;

    if (portName.toUpperCase().indexOf("JMS") != -1
        && !TestUtilities.areWeTesting("jms")) {
        return;
    }

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

                        + "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

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.