1 / 20

Web サービス II ( 第 8 回)

Web サービス II ( 第 8 回). 2005年 12 月1日 http://www.wakhok.ac.jp/~tatsuo/ws2/. この時間の目標. 新しい Service Registry の理解 JAXR によるアプリケーションからのアクセス ( 前回との比較 ) 古いサンプル %JWSDP_HOME%jaxrsamples 新しいサンプル %JWSDP_HOME%egistrysamples. UDDI Ver 2 から Ver 3  へ. キーの定義の拡張 Ver 2 UUID のみ サーバが登録時に生成

binah
Download Presentation

Web サービス II ( 第 8 回)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Webサービス II (第8回) 2005年12月1日 http://www.wakhok.ac.jp/~tatsuo/ws2/

  2. この時間の目標 • 新しい Service Registry の理解 • JAXRによるアプリケーションからのアクセス(前回との比較) • 古いサンプル %JWSDP_HOME%\jaxr\samples • 新しいサンプル %JWSDP_HOME%\registry\samples

  3. UDDI Ver 2 から Ver 3 へ • キーの定義の拡張 • Ver 2 UUIDのみ サーバが登録時に生成 • Ver 3 URNに一般化 urn:uddi-org:api_v2:public urn:uuid:469ea252-d39b-45ba-a863- eb467f6ebcbf

  4. URL, URI, URN • URL(Universal Resource Locator) 実際のリソースの保存場所の指定 http://www.wakhok.ac.jp/index.html • URI(Universal Resource Identifier) 世界で唯一の存在の「目印」 <wakhok:doc xmlns:wakhok= http://www.wakhok.ac.jp/public > • URN(Universal Resource Name) 世界で唯一の名前(場所ではなく名前)

  5. キーの拡張の結果 • キーの生成はサーバのみでない • 複数のサーバに登録可能 • 複数のサーバの連携が可能

  6. もう1つの目玉 ebXML • e-business のためのXMLの標準化 http://www.ebxml.org/ • 新しい Service Registry は ebXML 3.0 にも対応

  7. なぜ JAXRが使えるのか? • 従来の JAXRのAPIでアクセス可能! • JAXRには拡張された形跡がない! • JAXRは高度に抽象化された API • サーバの実装(UDDI)に依存しない記述

  8. 抽象化の例(1) • 通信の開始 ConnectionFactory factory = JAXRUtility.getConnectionFactory(); Properties props = new Properties(); props.setProperty( “…..”, “url” ); factory.setProperties(props); Connection connection= factory.createConnection();

  9. 抽象化の例(2) • サーバへの問い合わせ RegistryService rs = null; BusinessQueryManagerImpl qm = null; rs = connection.getRegistryService(); qm = (BusinessQueryManagerImpl) rs.getBusinessQueryManager(); BulkResponse response = qm.findObjects("RegistryObject", null, namePatterns, null, null, null, null);

  10. 抽象化の例(3) • 情報の取り出し Collection objects =response.getCollection(); Iterator objIter = objects.iterator(); while (objIter.hasNext()) { RegistryObject object = (RegistryObject) objIter.next(); Concept objType = object.getObjectType();

  11. 実習の手順 • JWSDPのTomcatの起動 http://localhost:8080/soarにアクセス • %JWSDP_HOME%\reigistry\samples の下の commons に移動 • 共通の設定ファイルの確認と必要項目の追加(build.properties, targets.xml) • 各サンプルのサブディレクトリに移動 ant によるコンパイルと実行

  12. build-properties (環境変数追加) • container.home=z:/tomcat50-jwsdp • jwsdp.home=z:/jwsdp-1.6 • registry.home=z:/jwsdp-1.6/registry • jaxp.home=z:/jwsdp-1.6/jaxp • jaxr.home=z:/jwsdp-1.6/jaxr • jaxb.home=z:/jwsdp-1.6/jaxb • soap.home=z:/jwsdp-1.6/saaj

  13. targets.xml (クラスパス追加1) <fileset dir="${container.home}/common/lib"> <fileset dir= "${container.home}/common/endorsed">

  14. targets.xml (クラスパス追加2) <fileset dir="${jaxr.home}/lib"> <include name="*.jar"/> </fileset> <fileset dir="${jwsdp.home}/jwsdp-shared/lib"> <include name="*.jar"/> </fileset> <fileset dir="${soap.home}/lib"> <include name="*.jar"/> </fileset> : :

  15. サンプルの実行例(1) • query-name (名前のパターンで検索) • コンパイル ターゲット名 compile (デフォルト) • 実行 ターゲット名 run プロパティ name を通じて検索パターン ant run -Dname=“Japan” ant run -Dname=“Ja%”

  16. サンプルの実行例(2) • query-object-type (型で検索) • コンパイル ターゲット名 compile (デフォルト) • 実行 ターゲット名 run プロパティ type を通じて検索パターン ant run -Dtype=“Organization”

  17. サンプルの実行例(3) • Organizations (企業情報の登録、検索) (複数のプログラムで構成) • コンパイル(一括でコンパイル) ターゲット名 compile (デフォルト) • 実行 起動プログラムをターゲット名で指定 ant pub-org (企業情報の登録) JAXRExamples.properties に登録内容

  18. サンプルの実行例(4) • delete-object (情報の削除) • 実行 ターゲット名 run プロパティ id を通じてオブジェクトのキー ant run -Did= "urn:uuid:469ea252-d39b-45ba…” • キーの値は登録時に表示 or ブラウザで • 登録や削除をブラウザでも確認

  19. キーの値は Details をクリック

  20. Organization の登録数を確認

More Related