Designing Web Services

This topics lists some of the most import design issues involved in building a web service.

Client Applications

When you are designing and building a web service you are typically trying to expose some resource to an outside client application, a client application that will call on the web service to perform some operation or return some data. The client application that calls your web service might be a JSP page, a Java application, a VisualBasic application or any software application that can communicate using XML messages. When writing your web service, you might want to consider what sort of client is likely to call you web service and what its capabilities are. If the client cannot support callbacks from the web service you might consider eliminating callbacks your web services client interface, or inform any potential clients that they should use a polling interface to connect to you web service. A polling interface is one where the client periodically calls on the web service to see if has completed an invoked operation. For more information on polling interfaces see Using Polling as an Alternative to Callbacks. For more information about callbacks see Using Callbacks to Notify Clients of Events.

Network Latency

Because web services are involved with transmitting data across networks, your web service design should address the issue of network latency. Latency refers to the time a client must wait for a request to be processed and returned over the network. A number of factors go into determining network latency. A network may have more traffic at certain times of the day, thereby increasing the network latency; or a web service may not be able to complete a process until a human intervenes to input some data or authorize some step in the process.

One way to cope with network latency you can build an asynchronous web service, which does not require that the client application halt and wait for the web service to process and return the requested data. Instead, an asynchronous web service immediately returns a simple acknowledgment to the client that a request has been received, and then, at a later time, the web service sends a callback to the client containing the full response. Asynchronous web services must implement conversational phases to keep track of which response should be sent to which client. For more information asynchronous web services and using conversational phases see Designing Asynchronous Interfaces.

Related Topics

None