Interstage Application Server UDDIサービス ユーザーズガイド
|
目次
索引

|
5.1.3 Webサービス情報の登録
samplesディレクトリの下の loadxml ディレクトリに含まれているサンプルは、UDDIレジストリに対する呼び出しのパラメタを XML ファイルから読み取るサンプルです。
このサンプルは、XMLファイルから読み出したパラメタを元に save_business 呼び出しを行います。
save_business に指定するビジネスデータのように、呼び出しの種類によってはパラメタの構造が非常に複雑になりやすい場合があります。こうした場合は、パラメタ用のオブジェクトを一つ一つ生成するのではなく、あらかじめ作成した XML ファイルを元に生成するとメンテナンス性が向上します。
その他、このサンプルは登録系 API の呼び出しを行うサンプルにもなっています。このサンプルプログラムでは、サーバからのレスポンスを XML ファイルとして保存します。
以下にサンプルの構成ファイルの一覧を示します。

C:\Interstage\F3FMuddic\samples\loadxml
- LoadXML.java ... サンプルのソースコード
- LoadXML.class ... LoadXML.java のバイナリコード
- Util.java ... LoadXML で使われるユーティリティクラス
- Util.class ... Util.java のバイナリコード
- DOMWriter.java ... XML ファイルへの保存を行うユーティリティクラス
- DOMWriter.class ... DOMWriter.java のバイナリコード
- myBusiness.xml ... 登録用ビジネスデータのサンプル
- callprop ... 設定用プロパティファイル
- run.bat ... 実行用スクリプトファイル


/opt/FJSVuddic/samples/loadxml
- LoadXML.java ... サンプルのソースコード
- LoadXML.class ... LoadXML.java のバイナリコード
- Util.java ... LoadXML で使われるユーティリティクラス
- Util.class ... Util.java のバイナリコード
- DOMWriter.java ... XML ファイルへの保存を行うユーティリティクラス
- DOMWriter.class ... DOMWriter.java のバイナリコード
- myBusiness.xml ... 登録用ビジネスデータのサンプル
- callprop ... 設定用プロパティファイル
- run ... 実行用スクリプトファイル
サンプルの実行には同ディレクトリの実行用スクリプトファイルをご利用ください。スクリプトファイルの引数は以下のようになります。引数のプロパティファイルには設定用プロパティファイル(callprop)を指定してください。レスポンス保存用XMLファイル名には、UDDIレジストリからの save_business 呼び出しのレスポンスの保存先となるファイルを指定します。
run プロパティファイル レスポンス保存用XMLファイル名 |
スクリプトファイルの実行の前には以下の作業を完了している必要があります。
- SOAPクライアント実行環境の環境構築が完了している
- UDDIクライアントのCLASSPATH設定が完了している
- クライアント側のSSL通信の環境構築が完了している
- callprop 内のレジストリに対するアカウント情報の設定が完了している
- (必要なら)callprop 内の問い合わせを行う UDDIレジストリの設定が完了している
- (必要なら)callprop 内のプロキシ設定部分の修正が完了している
- (必要なら)myBusiness.xml 内の登録内容の修正が完了している
レジストリの URL と、登録系 API の利用に必要なアカウント情報の設定は callprop の以下の個所で行います。
サービス提供 URL は、プロパティ org.uddi4j.inquiryURL と org.uddi4j.publishURL に設定します。デフォルトでは 米IBM社 の UDDIビジネスレジストリが指定されています。
アカウント情報の設定は、ユーザID をプロパティ registry.id の値に、パスワードをプロパティ registry.password の値に設定します。
# ===================================================
# Registry Information
# ===================================================
## NOTE:
## If you want to publish your business data, maybe you need to
## add a root SSL certificate into your SSL keystore before publishing.
##
## About how to add a root SSL certificate, please check the
## Interstage Application Server Security System Operation Guide.
##
## NOTE:
## If you want to publish your business data, you must get your account
## on the target registry at first.
## IBM UDDI V2.0 site
org.uddi4j.inquiryURL=http://uddi.ibm.com/ubr/inquiryapi
org.uddi4j.publishURL=https://uddi.ibm.com/ubr/publishapi
registry.id =
registry.password =
# Microsoft UDDI V2.0 site
# org.uddi4j.inquiryURL=http://uddi.microsoft.com/inquire
# org.uddi4j.publishURL=https://uddi.microsoft.com/publish
# registry.id =
# registry.password = |
プロキシを利用する場合は、callprop の以下の個所のコメントアウトされているプロパティを有効にしてから、http.proxyHost、 http.proxyPort、 https.proxyHost、 https.proxyPort、http.proxyUserName、 http.proxyPassword の値を修正してください。プロキシの Basic 認証を行わない場合は http.proxyUserName、 http.proxyPassword はコメントのままにしておいてください。
# ===================================================
# Proxy settings
# ===================================================
# http.proxyHost=your.proxy.host.name
# http.proxyPort=your.proxy.port.number
# https.proxyHost=your.proxy.host.name
# https.proxyPort=your.proxy.port.number
# http.proxyUserName=your.proxy.basic-auth.userID
# http.proxyUserName=your.proxy.basic-auth.userID |
また、登録用ビジネスデータを格納するファイルを myBusiness.xml から変更したい場合は、callprop 内の business.content プロパティの値を変更してください。
#====================================================
#
# my business
#
# ===================================================
business.content = myBusiness.xml |

■登録されたビジネスデータの識別情報
実行時に指定されたレスポンス保存用XMLファイルには、UDDIレジストリからのレスポンスである登録されたビジネスデータの情報が書き込まれます。このファイルに書き込まれているbusinessKey情報は、UDDIレジストリによって与えられるビジネスデータを一意に判別するための識別子です。このbusinessKey情報は、『Webサービス情報の削除』・『拡張属性の登録』・『拡張属性の検索』等のサンプルプログラムを実行する際に利用することができます。
実行時にレスポンス保存用XMLファイルに保存されるビジネスデータの例を、以下に示します。UDDIレジストリによって与えられたbusinessKey情報が記述されています。また保存されたビジネスデータは見やすいように編集したものになっています(レジストリによって値が異なったり、設定されなかったりする可能性のある所については隠しています)。実際の確認作業では、Internet Explorer 6などの、XMLの構造を整形して表示するツールを利用すると便利です。

<?xml version="1.0" encoding="UTF-8" ?>
<businessDetail
generic="2.0"
xmlns="urn:uddi-org:api_v2"
operator="xxxxxxxxxxxx">
<businessEntity
businessKey="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
operator="xxxxxxxxxxxx"
authorizedName="xxxxxxxxxxxxxxxx">
<discoveryURLs>
<discoveryURL useType="businessEntity">
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
</discoveryURL>
</discoveryURLs>
<name>Interstage User</name>
<description>Web Service Provider</description>
<businessServices>
<businessService
serviceKey="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
businessKey="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx">
<name>Our Home Page</name>
<description>Welcome to our Home Page</description>
<bindingTemplates>
<bindingTemplate
bindingKey="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
serviceKey="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx">
<description>Support Browser: IE5.X, NS4.X</description>
<accessPoint URLType="http">
http://web.service.provider.test/
</accessPoint>
<tModelInstanceDetails>
<tModelInstanceInfo
tModelKey="uuid:4cec1cef-1f68-4b23-8cb7-8baa763aeb89">
<description>HTTP Web Home Page URL (uddi-org:homepage)</description>
</tModelInstanceInfo>
</tModelInstanceDetails>
</bindingTemplate>
</bindingTemplates>
</businessService>
</businessServices>
</businessEntity>
</businessDetail> |
All Rights Reserved, Copyright(C) 富士通株式会社 2005