This section will show you how to implement a subscription notification service. When you create a BEA AquaLogic Service Registry subscription you can specify a notification listener service endpoint as described in Subscriptions in BEA AquaLogic Service Registry. In this chapter, we describe the following use case: The user wants to create a service that will be executed when a subscription notification is sent. The listener notification service will be deployed on the Systinet Server for Java.
The procedure of creating and deploying the subscription notification consist of the following steps:
Create subscription notification service class. Package the notification service class with necessary wsdl, schema, and deployment descriptor files.
Deploy the service notification package with the required BEA AquaLogic Service Registry client packages into Systinet Server for Java.
Create a subscription using the Registry Console.
![]() | Note |
---|---|
We assume BEA AquaLogic Service Registry is installed in REGISTRY_HOME folder and running at http://localhost:8080/, and that Systinet Server for Java is installed in WASP_HOME folder and running at http://localhost:6060/. |
Now we will describe the process in detail:
Create the subscription notification service class shown in Example 14
Compile the ExampleNotificationListener.java using:
javac -classpath%REGISTRY_HOME%\dist\uddiclient_api_v3.jar; %REGISTRY_HOME%\dist\uddiclient_core.jar; %REGISTRY_HOME%\dist\uddiclient_subscription_listener_v3.jar; %REGISTRY_HOME%\dist\uddiclient_subscription_v3.jar ExampleNotificationListener.java
Package the ExampleNotificationListener.class with necessary wsdl, schema and deployment descriptor file as follows:
Create a jar file ExampleNotificationListener.jar with the following structure:
Copy the wsdl and schema files from REGISTRY_HOME/doc/wsdl to the package.
Copy the package.xml file shown in Example 15 to the package.
Deploy the service notification package with required BEA AquaLogic Service Registry client packages into Systinet Server for Java 5.5.
copy %REGISTRY_HOME%\dist\uddiclient_api_v3.jar %WASP_HOME%\app\system\uddi
copy %REGISTRY_HOME%\dist\uddiclient_subscription_v3.jar %WASP_HOME%\app\system\uddi
copy %REGISTRY_HOME%\dist\uddiclient_subscription_listener_v3.jar %WASP_HOME%\app\system\uddi
copy ExampleNotificationListener.jar %WASP_HOME%\app\system\uddi
Shutdown the Systinet Server for Java, delete the WASP_HOME/work directory, and restart the Systinet Server for Java
Create a subscription using the Registry Console.
See Publishing Subscriptions for instructions on how to create a subscription.
Publish the subscription with the Notification listener type Service endpoint. Enter the Notification listener endpoint as http://your.computer.name.com:6060/ExampleNotificationListener as shown in Figure 11
Example 14. ExampleNotificationListener.java
package com.systinet.subscription; import org.systinet.uddi.client.subscription.listener.v3.UDDI_SubscriptionListener_PortType; import org.systinet.uddi.client.subscription.listener.v3.struct.Notify_subscriptionListener; import org.systinet.uddi.client.v3.UDDIException; import org.systinet.uddi.client.v3.struct.DispositionReport; public class ExampleNotificationListener implements UDDI_SubscriptionListener_PortType{ public DispositionReport notify_subscriptionListener(Notify_subscriptionListener body) throws UDDIException { System.out.println(body.toXML()); DispositionReport result = DispositionReport.DISPOSITION_REPORT_SUCCESS; return result; } }
Example 15. package.xml
<?xml version="1.0" encoding="UTF-8"?> <package xmlns="http://systinet.com/wasp/package/1.2" xsi:schemaLocation="http://systinet.com/wasp/package/1.2 http://systinet.com/wasp/package/1.2" targetNamespace="http://my.org" version="1.0" name="ExampleNotificationListener" client-package="false" library="false" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://my.org" xmlns:uddi_subr_v3="urn:uddi-org:subr_v3_binding" xmlns:uddiclient_subscription_listener_v3= "http://systinet.com/uddi/client/subscription/listener/v3/5.0"> <dependency ref= "uddiclient_subscription_listener_v3:UDDIClient-subscription-listener-v3" version="5.0"/> <service-endpoint name="ExampleNotificationListener" path="/ExampleNotificationListener" service-instance="tns:ExampleNotificationListenerInstance" processing="uddiclient_subscription_listener_v3:UDDIClientProcessing"> <wsdl uri="uddi_subr_v3.wsdl" service="uddi_subr_v3:UDDI_SubscriptionListener_SoapService"/> </service-endpoint> <service-instance name="ExampleNotificationListenerInstance" implementation-class="com.systinet.subscription.ExampleNotificationListener" preload="false" ttl="600" instantiation-method="shared"/> </package>