Previous Next vertical dots separating previous/next from contents/index/pdf

Handling Web Service Callback Messages

This topic explains how a web service control handles callback messages sent from a web service and passes them on to a control client.

A Web Service Callback Scenario

Suppose you have a web service that sends callback messages back to the client through a service control.

The following diagram shows how the client, service control, and web service are related. The client is a web service named, the service control is, and the target web service is

Arrows pointing the right are ordinary methods. Arrows pointing to the left depict an event handler method (onMessage_handler on the client), an event set method (onMessage on the service control), and a callback method (onMessage on the target web service).

Setting up a Callback Message Handler

Assume that the source code for the callback method onMessage on is as follows:

public class HelloWorldWebService {
    public interface CallbackSvc {
        public void onMessage(String aMessage);

To handle this callback message in a service control, add an event set interface that includes a method with the same name as the callback method, decorated with the annotation @ServiceControl.ExternalCallbackEvent.

    public interface Callback
        public void onMessage(java.lang.String aMessage_arg);

For information on using a service control in a client, see Creating and Using a Service Control.

For information on setting up a callback interface in a web service see Web Service Callbacks.

Automatically Generating a Service Control

You can automatically generate a service control with the appropriate event set methods by right-clicking on the target web service's WSDL and selecting Web Service > Generate Service Control. A service control will be generated with event set methods corresponding to all of the callback methods in the target web service.

Related Topics

Creating and Using a Service Control

Web Service Callbacks


Skip navigation bar   Back to Top