応答を期待せずにメッセージを送信
このシナリオは、Talend ESB、Talend Data Services Platform、Talend MDM Platform、Talend Real-Time Big Data Platform、Talend Data Fabricにのみ適用されます。
このシナリオでは、プロバイダージョブとコンシューマージョブが必要になります。ESB/Web Servicesファミリー下のコンポーネントに基づいて構築されたジョブは、[Repository] (リポジトリー)の[Services] (サービス)ノードで定義されたWebサービスの実装として機能します。
- [Repository] (リポジトリー)ツリービューで、[Services] (サービス)ノードを右クリックして、コンテキストメニューから[Create Service] (サービスを作成)を選択します。
- ポップアップウィザードで[Name] (名前)フィールドにServiceRequestと入力し、[Next] (次へ)をクリックします。
- [Create new WSDL] (WSDLの新規作成)オプションを選択します。
- [Finish] (終了)をクリックし、この作成を確定します。デザインワークスペースでサービスが開かれます。
- WSDLスケルトンでServiceRequestPortポートを右クリックし、[Show properties] (プロパティを表示)を選択します。[Address] (アドレス)フィールドで、サービスを公開するアドレス(http://127.0.0.1.8088/esb/providerなど)を指定します。
- WSDLスケルトンのポートタイプとしてServiceRequestPortTypeをクリックします。この名前をTEST_ProviderJobSoapBindingに変更します。
- WSDLスケルトンの操作としてServiceRequestOperationをクリックします。この名前をinvoke(anyType):anyTypeに変更します。
- WSDLファイルを保存します。[Repository] (リポジトリー)ビューのServicesノードの下に、新しく定義されたWebサービスが表示されます。
- ServicesノードでServiceRequest 0.1を右クリックし、[Import WSDL Schemas] (WSDLスキーマをインポート)を選択します。このオプションにより、[Metadata] (メタデータ) > [File xml] (XMLファイル)の下でWSDLメタデータがサービスからリポジトリーにインポートされるので、サービスや他のコンポーネント間で操作内容を共有できるようになります。
プロバイダージョブは、tESBProviderRequest、tXMLMap、および2つのtLogRowコンポーネントで構成されます。

-
[Palette] (パレット)からデザインワークスペースに次のコンポーネントをドロップします。tESBProviderRequest、tXMLMap、2つのtLogRow。
-
デザインワークスペースでtESBProviderRequest_1をダブルクリックして、その[Component] (コンポーネント)ビューを表示し、[Basic settings] (基本設定)を設定するために使われます。

-
[Property Type] (プロパティタイプ)リストから[Repository] (リポジトリー)を選択し、[...]ボタンをクリックしてポート名と操作の粒度に合わせてサービスを選択します。

-
[OK]をクリックします。
-
[Edit schema] (スキーマを編集)の横にある[...]ボタンをクリックして、tESBProviderRequest_1のスキーマを表示します。

-
[OK]をクリックします。
-
tESBProviderRequest_1をtLogRow_1に接続します。
-
デザインワークスペースでtLogRow_1をダブルクリックして、その[Component] (コンポーネント)ビューを表示し、[Basic settings] (基本設定)を設定するために使われます。

-
[Edit schema] (スキーマを編集)の横にある[...]ボタンをクリックして、次のようにスキーマを定義します。

-
tLogRow_1をtXMLMap_1に接続します。
-
tXMLMap_1をtLogRow_2に接続し、この行をpayloadという名前にします。
-
デザインワークスペースで、tXMLMap_1をダブルクリックして、[Map Editor] (マップエディター)を開きます。
-
マップエディターの右下にある[+]をクリックして、payloadテーブルに1行を追加し、この行をpayloadという名前にします。
-
このpayload行の[Type] (タイプ)カラムで、[Document] (ドキュメント)をデータ型として選択します。対応するXMLルートは、出力フローを表す右側のトップテーブルに自動的に追加されます。
-
payloadテーブルで、rootを右クリックしてコンテキストメニューを開きます。
-
コンテキストメニューで[Create Sub-Element] (サブエレメントの作成)を選択し、ポップアップダイアログボックスにresponseを入力します。
-
responseノードを右クリックし、コンテキストメニューで[As loop element] (ループエレメントとして)を選択します。
-
この操作を繰り返して入力テーブルのrootノードのサブエレメントrequestを作成し、requestノードをループエレメントとして設定します。
-
入力テーブルのrequestノードをクリックし、出力テーブルのresponseノードの行の[Expression] (式)カラムにドロップします。

-
[OK]をクリックしてマッピングを検証し、マップエディターを閉じます。
-
デザインワークスペースでtLogRow_2をダブルクリックして、その[Component] (コンポーネント)ビューを表示し、[Basic settings] (基本設定)を設定するために使われます。

-
[Edit Schema] (スキーマを編集)の横にある[...]ボタンをクリックして、次のようにスキーマを定義します。

-
ジョブを保存します。
コンシューマージョブは、tFixedFlowInput、tXMLMap、tESBConsumer、2つのtLogRow コンポーネントで構成されます。

-
[Palette] (パレット)からデザインワークスペースに次のコンポーネントをドロップします。tFixedFlowInput、tXMLMap、tESBConsumer、2つのtLogRow。
-
デザインワークスペースでtFixedFlowInput_1をダブルクリックして、その[Component] (コンポーネント)ビューを表示し、[Basic settings] (基本設定)を設定するために使われます。

-
tFixedFlowInput_1コンポーネントのスキーマを編集します。

-
[+]ボタンをクリックしてString型の行を新規追加して、payloadStringという名前を付けます。
-
[OK]をクリックします。
-
[Number of rows] (行数)フィールドに行数1を設定するために使われます。
-
[Mode] (モード)エリアで、[Use Single Table] (単一テーブルを使用)を選択し、[Value] (値)フィールドにworldを引用符付きで入力します。
-
tFixedFlowInput_1をtXMLMap_1に接続します。
-
tXMLMap_1をtESBConsumer_1に接続し、この行をpayloadという名前にします。
-
デザインワークスペースで、tXMLMap_1をダブルクリックして、[Map Editor] (マップエディター)を開きます。
-
出力テーブルで、rootノードを右クリックしてコンテキストメニューを開きます。
-
コンテキストメニューで[Create Sub-Element] (サブエレメントの作成)を選択し、ポップアップダイアログボックスにrequestを入力します。
-
requestノードを右クリックし、コンテキストメニューで[As loop element] (ループエレメントとして)を選択します。
-
入力テーブルのpayloadstringノードをクリックし、出力テーブルのrequestノードの行の[Expression] (式)カラムにドロップします。

-
[OK]をクリックしてマッピングを検証し、[Map Editor] (マップエディター)を閉じます。
-
プロバイダージョブを開始します。実行ログには次の情報が表示されます。
... web service [endpoint: http://127.0.0.1:8088/esb/provider] published ...
-
tESBConsumer_1[Component] (コンポーネント)ビューで、[Basic settings] (基本設定)を設定するために使われます。

-
[Service Configuration] (サービス設定)フィールドの横にある[...]ボタンをクリックして、エディターを開きます。

-
[WSDL]フィールドで、http://127.0.0.1:8088/esb/provider?WSDLを入力します。
-
更新ボタンをクリックし、ポート名と操作名を取得します。
-
[OK]をクリックします。
-
tESBConsumerの[Basic settings] (基本設定)で、次のように[Input Schema] (スキーマの入力)を設定するために使われます。

-
[Response Schema] (応答スキーマ)を次のように設定します。

-
[Fault Schema] (フォールトスキーマ)を次のように設定します。

-
tESBConsumer_1をtLogRow_1とtLogRow_2に接続します。
-
デザインワークスペースでtLogRow_1コンポーネントをダブルクリックして、その[Component] (コンポーネント)を表示し、[Basic settings] (基本設定)を設定するために使われます。

-
[Edit Schema] (スキーマを編集)の横にある[...]ボタンをクリックして、次のようにスキーマを定義します。

-
ジョブでtLogRow_2をダブルクリックして、その[Component] (コンポーネント)を表示し、[Basic settings] (基本設定)を設定するために使われます。

-
[Edit Schema] (スキーマを編集)の横にある[...]ボタンをクリックして、次のようにスキーマを定義します。

-
ジョブを保存します。
-
プロバイダージョブを実行します。実行ログには次の情報が表示されます。
INFO: Setting the server's publish address to be http://127.0.0.1:8088/esb/provider
2011-04-21 14:14:36.793:INFO::jetty-7.2.2.v20101205
2011-04-21 14:14:37.856:INFO::Started
SelectChannelConnector@127.0.0.1:8088
web service [endpoint: http://127.0.0.1:8088/esb/provider] published
-
コンシューマージョブを実行します。ジョブの実行ログには次の情報が表示されます。
Starting job CallProvider at 14:15 21/04/2011. [statistics] connecting to socket on port 3942 [statistics] connected TEST_ESBProvider2 TEST_ESBProvider2SoapBingding | [tLogRow_2] payloadString: <request>world</request> {http://talend.org/esb/service/job}TEST_ESBProvider2 {http://talend.org/esb/service/job}TEST_ESBProvider2SoapBinding invoke [tLogRow_1] payload: null [statistics] disconnected Job CallProvider2 ended at 14:16 21/04/2011. [exit code=0]
-
プロバイダーのログにトレースログが表示されます。
web service [endpoint: http://127.0.0.1:8088/esb/provider] published [tLogRow_1] payload: <?xml version="1.0" encoding="UTF-8"?> <request>world</request> ### world [tLogRow_2] content: world [tLogRow_3] payload: <?xml version="1.0" encoding="UTF-8"?> <response xmlns="http://talend.org/esb/service/job">Hello, world!</response> web service [endpoint: http://127.0.0.1:8088/esb/provider] unpublished [statistics] disconnected Job ESBProvider2 ended at 14:16 21/04/2011. [exit code=0]