付録D.2 サービスの概要インターフェースを検討する
ミドルレベル・ビジネスプロセスの検討が終わったら,サービスの概要インターフェースを検討し,検討した結果を基に概要WSDLを作成します。検討するサービスを次に示します。
-
在庫引当サービス(InventoryManager)
-
配送手配サービス(Delivery)
-
商品手配ビジネスプロセス (ArrangementService)
- 〈この項の構成〉
(1) 概要インターフェースを検討する
最初に,サービスの概要インターフェースを検討します。次の図のように,サービスリクエスタから見ると商品手配ビジネスプロセス自体もサービスになるため,概要インターフェースの検討対象になります。
|
|
商品手配システムでは,次の図および次の表のように概要インターフェースを決定したものとします。
|
|
|
項番 |
サービス名 |
提供オペレーション名 (オペレーションの内容) |
要求メッセージ名 |
応答メッセージ名 |
|---|---|---|---|---|
|
1 |
在庫引当サービス |
reserveItem (商品を在庫引当する) |
reserveItemRequest |
reserveItemResponse |
|
2 |
配送手配サービス |
deliverItem (商品を配送する) |
deliverItemRequest |
deliverItemResponse |
|
3 |
商品手配ビジネスプロセス |
arrangeItem (商品を手配し配送する) |
arrangeItemRequest |
arrangeItemResponse |
(2) 概要WSDLを作成する
概要インターフェースが決定したら,概要WSDLを作成します。商品手配システムでは,サービスごとに次の表に示す名前でWSDLファイルを作成します。
|
項番 |
サービス名 |
WSDLファイルの名前 |
|---|---|---|
|
1 |
在庫引当サービス |
InventoryManagementService.wsdl |
|
2 |
配送手配サービス |
DeliveryService.wsdl |
|
3 |
商品手配ビジネスプロセス |
ArrangementService.wsdl |
概要WSDLを作成するときのポイントは次のとおりです。
- 概要WSDL作成のポイント
-
-
サービス名をwsdl:portのname属性に記述する。
-
提供オペレーション名をwsdl:operationのname属性に記述する。
-
要求メッセージ名をwsdl:inputのname属性に記述する。
-
応答メッセージ名をwsdl:outputのname属性に記述する。
-
メッセージの構造は記述しない
(ルート要素だけを宣言し,型はxsd:stringなどの基本型にする)。
-
在庫引当サービスのWSDL(InventoryManagementService.wsdl)の例を次に示します。WSDL中の太字は「概要WSDL作成のポイント」で示した部分の記述を表します。
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
targetNamespace="http://sample/InventoryManagementService"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ims="http://sample/InventoryManagementService">
<wsdl:types>
<xsd:schema
targetNamespace="http://sample/InventoryManagementService"
elementFormDefault="qualified">
<xsd:element name="reserveItem" type="xsd:string" />
<xsd:element name="reserveItemResponse" type="xsd:string" />
</xsd:schema>
</wsdl:types>
<wsdl:message name="reserveItemRequest">
<wsdl:part name="parameters" element="ims:reserveItem" />
</wsdl:message>
<wsdl:message name="reserveItemResponse">
<wsdl:part name="parameters" element="ims:reserveItemResponse" />
</wsdl:message>
<wsdl:portType name="InventoryManager">
<wsdl:operation name="reserveItem">
<wsdl:input message="ims:reserveItemRequest" name="reserveItemRequest" />
<wsdl:output message="ims:reserveItemResponse" name="reserveItemResponse" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="InventoryManagerSoapBinding" type="ims:InventoryManager">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="reserveItem">
<soap:operation soapAction="" />
<wsdl:input name="reserveItemRequest">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="reserveItemResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="InventoryManagementService">
<wsdl:port binding="ims:InventoryManagerSoapBinding" name="InventoryManager">
<soap:address location="http://localhost/InventoryManagementServiceWeb/services/InventoryManager" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>