Web Services Invocation Framework:
Java Sample

This sample aims to demonstrate the invocation of the local java class through WSIF's API. Why would one want to do this, you ask? The main reason is that having a uniform view of software through WSDL necessitates this. It is also useful when developing a web service - you write your web service in java, expose it through WSDL with a java binding. Then you can test this using a client that employs WSIF's API to invoke the service. Since you are really using a java class, there is nothing to deploy, no web server to stop and start, etc. When you are satisfied that the functionality works, you can replace the binding in the WSDL with a SOAP binding, deploy the service as a SOAP service and retest with your client - which you don't need to change at all. Following this path in your Web services development reduces debugging pains one usually has with SOAP services, by making sure the basic functionality works before moving to a SOAP binding.

In this particular sample, we describe an AddressBook service. For those unfamilar with it, this service offers a port type with three operations. Two of the operations add an entry to the address book, using slightly different styles for providing input information. The third operation queries the address book with a name. The service uses complex schema types for representing an address and a phone number.

The abstract functionality is tied to a java binding that describes how a java class supports the abstract port type defined. This isn't a standard WSDL binding, instead this binding is defined as a part of WSIF; you can find details on how to write a java binding here.

The WSDL file is in this sample directory.

Here's how this service is implemented.

Here's how to invoke this service dynamically using WSIF's dynamic invocation interface (DII).

Here's how to invoke this service by first generating the stub interface and using this directly through WSIF's dynamic proxy, thus hiding all WSIF specifics from the client code. Note that the stub interface used is the the service interface as defined by the JAX-RPC specification.