この項では、サブスクリプション通知サービスの実装方法について説明します。 Oracle Service Registryサブスクリプションを作成する場合は、「Oracle Service Registryのサブスクリプション」の説明に従って、通知リスナー・サービス・エンドポイントを指定できます。この項では、サブスクリプション通知の送信時に実行されるサービスをユーザーが作成するユースケースについて説明します。リスナー通知サービスは、Systinet Server for Javaにデプロイされます。
サブスクリプション通知を作成およびデプロイするには、次の手順を実行します。
サブスクリプション通知サービス・クラスを作成します。必要なwsdl、スキーマおよびデプロイメント・ディスクリプタ・ファイルとともに、通知サービス・クラスをパッケージ化します。
必要なOracle Service Registryクライアント・パッケージとともに、サービス通知パッケージをSystinet Server for Javaにデプロイします。
レジストリ・コントロールを使用してサブスクリプションを作成します。
![]() | 注意 |
|---|---|
|
Oracle Service RegistryがREGISTRY_HOMEフォルダにインストールされており、http://localhost:8888/registry/で実行されていること、およびSystinet Server for JavaがWASP_HOMEフォルダにインストールされており、http://localhost:6060/で実行されていることが前提となっています。 | |
次に、各処理の詳細について説明します。
例13に示すように、サブスクリプション通知サービス・クラスを作成します。
次のように入力して、ExampleNotificationListener.javaをコンパイルします。
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
次の手順を実行して、必要なwsdl、スキーマおよびデプロイメント・ディスクリプタ・ファイルとともに、ExampleNotificationListener.classをパッケージ化します。
次の構造を使用して、jarファイルExampleNotificationListener.jarを作成します。

wsdlファイルおよびスキーマ・ファイルをREGISTRY_HOME/doc/wsdlからパッケージにコピーします。
例14に示すように、package.xmlファイルをパッケージにコピーします。
必要なOracle Service Registryクライアント・パッケージとともに、サービス通知パッケージをSystinet Server for Javaにデプロイします。
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
Systinet Server for Javaを停止し、WASP_HOME/workディレクトリを削除して、Systinet Server for Javaを再起動します。
レジストリ・コントロールを使用してサブスクリプションを作成します。
サブスクリプションの作成方法については、「サブスクリプションの公開」を参照してください。
通知リスナー・タイプ・サービス・エンドポイントを使用して、サブスクリプションを公開します。図11に示すように、通知リスナー・エンドポイントにhttp://your.computer.name.com:6060/ExampleNotificationListenerと入力します。
例13 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;
}
}例14 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"
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>