Grid/WS-RFと...

Preview:

Citation preview

Grid/WS-RFと

ビジネスプロセスの統合

稚内北星学園大学丸山不二夫

Agenda

1. OGSIからWS-RFへ--- 状態を持つリソースをいかにモデル化するか ---

2. WS-Addressing--- Message Information HeaderとEndpoint Reference ---

3. WS-Resource Property と WS-Notificaton

4. Webサービスとビジネス・プロセスの統合--- BPEL4WS ---

5. Gridとビジネス・プロセスの統合

6. J2EEとビジネス・プロセスの統合--- JSR 208 JBI (Java Business Integration) ---

OGSIからWSRFへ

Refactoring & Evolution

Grid = WSRF = Web Service

Grid と Web Servicesは接近してきた。

Grid

Web

OGSI

GT2

GT1

HTTPWSDL,

WS-*

WSDL 2,

WSDM

両者は、接近を続けてきた。 ?

最初はアプリも技術も遠く離れていた

しかし、すれ違って別の道を進む可能性が出てきた。

OGSIに対する熱狂にもかかわらず、WebサービスコミュニティからのOGSIの受容には

問題が多いことが明らかになった

WebサービスのコミュニティからのOGSIに対する四つの批判

1. ひとつの仕様にあまりに沢山の材料を詰め込みすぎてる。

2. Webサービスの一般的なツールが使えない

3. あまりにオブジェクト志向が強すぎた。

4. WSDL2.0で標準的に提供されるべき能力を、WSDL1.1の非標準的な拡大として実装した。

OGSA / OGSI

Web Services Messaging, Security, Etc.

Open Grid Services Infrastructure

Domain-Specific Services

Core Services

ProgramExecution Data Services

OGSA

OGSI

OGSA / WSRF

Web Services Messaging, Security, Etc.

Open Grid Services Infrastructure

Domain-Specific Services

Core Services

ProgramExecution Data Services

WS-Resource Framework

OGSA

WSRF

これまでのOGSA/OGSIとWebサービスの関係

Web Service

OGSI

OGSA

これからのOGSA/WSRFとWebサービスの関係

Web Service = WSRF

OGSA

Grid と Web ServicesはWSRFで、一体化する。

Grid

Web

OGSI

GT2

GT1

HTTPWSDL,

WS-*

WSDL 2,

WSDM

両者は、接近を続けてきた。

WSRF

最初はアプリも技術も遠く離れていた

WSRFの定義は、GridとWebサービスのコミュニティが、共通の土台の上に前進できるということを意味している。

WebService

BusinessProcess

Integration

GridOGSA/WSRF

Grid

GridOGSA/OGSI

WebサービスとGrid

WSRF関連のドキュメント群

Whitepapers & Specifications

http://www.globus.org/wsrf/#relevant

WSRFの5つの仕様

基礎となるFault型のXMLでの定義

WS-BaseFaults

複数のヘテロなWebサービスのグループを定義

WS-ServiceGroup

使えなくなったエンドポイントリファレンスの更新機能

WS-RenewableReferences

WSリソースの定義。プロパティ値の獲得、設定、削除

WS-ResourceProperties

WSリソースの生存時間の管理、WSリソースの破棄

WS-ResourceLifetime

内容仕様名

WS-Notificatonの3つの仕様

通知の生産者と消費者の中間の「通知ブローカ」のWebサービスのインターフェース定義

WS-BrokeredNotification

通知の購読に際して利用される「トピック」の系統的な構成法。あらかじめ、三つの方法を定義

WS-Topics

通知の生産者と消費者間のWebサービスのインターフェース定義

WS-BaseNotification

内容仕様名

WSRFの基本的な whitepaper

• Modeling Stateful Resources with Web Services

• The WS-Resource Framework• From Open Grid Services Infrastructure

to WS-Resource

• Publish-Subscribe Notification for Web services

OGSIとWSRFの仕様の対比

WS-BaseFaultsBase fault type

WS-ServiceGroupServiceGroup portTypesTreated as a patternFactory portTypeWS-NotificationNotification portTypesWS-ResourceLifetimeGridService lifetime mgmtWS-ResourcePropertiesService data defn & accessWS-RenewableReferencesHandleResolver portType

WS-Addressing Endpoint Reference

Grid Service Handle

WS-Addressing Endpoint Reference

Grid Service ReferenceWSRFOGSI

「状態を持つリソース」をどのようにWebサービスでモデル化するか?

同じ カウンター値

設定時刻

"initializedStatus“, "addStatus“,"subtractStatus“, "getValueStatus"

ServiceData status

ServiceData state

timestamp

status

value

add 123subtract 23getstate

OGSIサービス自身が状態を持つ

CounterClient

ServiceDataCounter

WS-Resourseとは何か?

「状態を持たないWebサービス」と「状態を持つリソース」を

分離したうえで、組み合わせたもの

WS-Resourse

状態を持つリソース状態を持たないWebサービス

WS-Resourseの「状態」としてのWS-Resource Properties Document

WS-Resourse<GenericDiskDrivePropertiesxmlns:tns="http://example.com/….” ><tns:NumberOfBlocks>22</tns:NumberOfBlocks><tns:BlockSize>1024</tns:BlockSize><tns:Manufacturer>DrivesRUs</tns:Manufacturer></GenericDiskDriveProperties>

WSDLのportTypeでResourceProperties Documentoを定義

<!-- Association of resource properties document to a portType --><wsdl:portType name="GenericDiskDrive"wsrp:ResourceProperties="tns:GenericDiskDriveProperties" >

Statefull-Resourseの「Projection」としてのWS-Resource Properties Document

<GenericDiskDrivePropertiesxmlns:tns="http://example.com/….” ><tns:NumberOfBlocks>22</tns:NumberOfBlocks><tns:BlockSize>1024</tns:BlockSize><tns:Manufacturer>DrivesRUs</tns:Manufacturer></GenericDiskDriveProperties>

wsrp:ResourceProperties=………..

同期が必要

J2EE Entity Bean一時的な情報

c1b1a1pk1c1b1a1pk1

Entity Bean データベース

永続する情報

状態を持つリソース A

状態を持つリソース B

単一のWebサービスが複数のリソースと関係するケース

状態を持つリソース C

状態を持つリソース

Webサービス A

Webサービス B

複数のWebサービスが単一のリソースと関係するケース

Webサービス C

これまでのWebサービス

EndPoint

WS-RF

状態を持つリソース

Webサービス

Webサービスインターフェース

状態を持つリソース

Endpoint メッセージ処理機能

メッセージ・ディスパッチ

メッセージ

Webサービス実行環境

J2EE Web Server EJB

Servlet/JSP DataBase

Web Browser

WS-Addressing

Message Information Headers

HTTP/1.0 200 OKDate: Wed, 20 Jun 2001 02:44:16 GMTServer: WhiteMesa SOAP Server/2.3Content-Type: text/xml; charset="utf-8"Content-Length: 508

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:EnvelopeSOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Body><m:echoStringResponse xmlns:m="http://soapinterop.org/">

<return>hello world</return></m:echoStringResponse>

</SOAP-ENV:Body></SOAP-ENV:Envelope> 通常のWebサービスの

レスポンス・メッセージ

SOAPメッセージにはアドレス情報が含まれていない

WS-Addressingサンプル

<S:Envelope xmlns:S=“http://www.w3.org/2003/05/ soap-envelope"xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/ addressing"><S:Header>

<wsa:ReplyTo><wsa:Address> http://business456.com/client1 </wsa:Address>

</wsa:ReplyTo><wsa:To> http://fabrikam123.com/Purchasing</wsa:To><wsa:Action> http://fabrikam123.com/SubmitPO</wsa:Action>

</S:Header><S:Body>

...</S:Body>

</S:Envelope>

SOAP-Headerにアドレス情報を埋め込む

Message Information Headers[宛先](必須)<wsa:To> xs:anyURI </wsa:To>

[送信元エンドポイント]<wsa:From> エンドポイントリファレンス </wsa:From>

[応答先エンドポイント]<wsa:ReplyTo> エンドポイントリファレンス </wsa:ReplyTo>

[障害報告エンドポイント]<wsa:FaultTo> エンドポイントリファレンス </wsa:FaultTo>

[アクション] (必須)<wsa:Action> xs:anyURI </wsa:Action>

[メッセージID]<wsa:MessageID> xs:anyURI </wsa:MessageID>

[関係]<wsa:RelatesTo RelationshipType="..."> xs:anyURI</wsa:RelatesTo>

Webサービスの拡大シナリオSMTPのサポート

HTTPに深く依存してきたWebサービスだが、

WS-Addressingによって、トランスポート層で、他のプロトコルの利用も可能となる。

Service A

MailBoxB

Web Service C

HTTPSMTP

WS-Addressingを利用すれば、アドレスもactionもSOAP-Envelopeの中に入るので、ネットワーク上のファイアウォールやルータを通りやすく出来る。

Webサービスの拡大シナリオリクエストとレスポンスの間隔が、

非常に長い場合への対応

沢山のビジネスプロセスが協調しあって、一つのサービスを提供しているような場合、長く処理時間がかかることがありえる。通常のWebサービスの場合には、コネクションがタイムアウトで切れてしまって、レスポンスが返れなくなる

Webサービスの拡大シナリオ一方向(One Way)のメッセージング

Webサービスで印刷Jobを実装したら、レスポンスに「印刷開始」をいれるか「印刷終了」を入れるか?

前者ではいつ印刷が終わるかわからないし、後者ではいつ印刷が始まったかわからない。どちらかをNotificationで実現するのがスマート。

WS-Addressing

Endpoint Reference

EndpointReferenceの定義

<wsa:EndpointReference><wsa:Address>xs:anyURI</wsa:Address><wsa:ReferenceProperties> ... </wsa:ReferenceProperties> ?<wsa:PortType>xs:QName</wsa:PortType> ?<wsa:ServiceName PortName="xs:NCName"?>

xs:Qname</wsa:ServiceName> ?<wsp:Policy/> *

</wsa:EndpointReference>

FactoryによるWS-Resourceの生成は、EndpointReferenceを返す

AB

C

Webサービス

状態を持つリソース

WS-Resource

WS-Resource Factory

ServiceRequestor

createService

AB

C

<wsa:EndpointReference> <wsa:Address>

http://someOrg.com/aWebService</wsa:Address> <wsa:ReferenceProperties>

<tns:resourceID> C </tns:resourceID> </wsa:ReferenceProperties>

</wsa:EndpointReference>

ServiceRequestor

Webサービス

EndpointReference

状態を持つリソース

Address要素

ReferenceProperties要素

AB

WS-Resource

WS-Resource-qualified EndpointReferenceとWS-Resource Context

<wsa:EndpointReference> <wsa:Address>

http://someOrg.com/aWebService</wsa:Address> <wsa:ReferenceProperties>

<tns:resourceID> C

</tns:resourceID> </wsa:ReferenceProperties>

</wsa:EndpointReference>

ReferencePropertyComponent

<tns:resourceID> C

</tns:resourceID>

WS-Resource context

AAddressComponent

B

Sample createWidgetResponce MessageHTTP/1.1 200 OKDate: Tue, 05 Feb 2004 05:21:35 GMTContent-Type: text/xml; charset=utf-8<?xml version="1.0" encoding="utf-8"?><soap:Envelope

xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing"xmlns:widget="http://widgets.com">

<soap:Header><wsa:Action soap:mustUnderstand="1">http://widgets.com/createWidgetResponse</wsa:Action><wsa:MessageID soap:mustUnderstand="1">uuid:00765982-76f1-41bd-9573-58ca18cee298</wsa:MessageID><wsa:To soap:mustUnderstand="1">http://schemas.xmlsoap.org/ws/2003/03/addressing/role/anonymous</wsa:To>

Sample createWidgetResponce Message<wsa:From soap:mustUnderstand="1"><wsa:Address>http://localhost/services/widgetService</wsa:Address></wsa:From><wsa:RelatesTo RelationshipType="wsa:Response">uuid:00765982-76f1-41bd-9573-58ca18cee299</wsa:RelatesTo></soap:Header><soap:Body><widget:createWidgetResponse><wsa:EndpointReference><wsa:Address>http://localhost/services/widgetService</wsa:Address><wsa:ReferenceProperties><widget:ResourceID>12345</widget:ResourceID></wsa:ReferenceProperties></wsa:EndpointReference></widget:createWidgetResponse></soap:Body></soap:Envelope>

EndpointReferenceのSOAPメッセージへのマッピング

A) エンドポイントリファレンスのwsa:Address情報は、SOAPメッセージの宛先wsa:Toにコピーされる。

B) エンドポイントリファレンスのwsa:ReferenceProperties情報は、SOAPメッセージのヘッダブロックになる。wsa:ReferenceProperties内のそれぞれの要素が、直接、ヘッダーブロックに追加される。

<wsa:EndpointReference> <wsa:Address>

http://someOrg.com/aWebService</wsa:Address> <wsa:ReferenceProperties>

<tns:resourceID> C </tns:resourceID> </wsa:ReferenceProperties>

</wsa:EndpointReference>

A

<soap:Envelope> <soap:Header>

<wsa:To> http://someOrg.com/aWebService </wsa:To><tns:resourceID> C </tns:resourceID>

</soap:Header> <soap:Body>… some message </soap:Body>

</soap:Envelope>

B

B

C

ServiceRequestor

C

クライアントからWS-リソースを参照する

A

<soap:Envelope> <soap:Header>

<tns:resourceID> C </tns:resourceID></soap:Header> <soap:Body>… some message </soap:Body>

</soap:Envelope>

Sample setTerminationTime Message

Content-Type: text/xml; charset=utf-8SOAPAction: "http://www.ibm.com/xmlns/stdwip/web-services/WS-ResourceLifetime/SetTerminationTime"Host: localhost<?xml version="1.0" encoding="utf-8"?><soap:Envelope

xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing"xmlns:wsrl="http://www.ibm.com/xmlns/stdwip/web-services/WS-

ResourceLifetime"xmlns:widget="http://widgets.com">

<soap:Header><wsa:Action soap:mustUnderstand="1">http://www.ibm.com/xmlns/stdwip/web-services/WS-

ResourceLifetime/SetTerminationTime</wsa:Action>

Sample setTerminationTime Message

<wsa:MessageID soap:mustUnderstand="1">uuid:00765982-76f1-41bd-9573-58ca18cee299</wsa:MessageID><wsa:To soap:mustUnderstand="1">http://localhost/services/widgetService</wsa:To><widget:ResourceID>12345</widget:ResourceID></soap:Header><soap:Body><wsrl:SetTerminationTime><wsrl:RequestedTerminationTime>2004-02-20T12:00:00</wsrl:RequestedTerminationTime></wsrl:SetTerminationTime></soap:Body></soap:Envelope>

A

B

WSRF ResourceProperties

<gwsdl:portType name="GridService"><operation name="findServiceData“ …. /><operation name="setServiceData“ …. /><operation name="requestTerminationAfter" …. /><operation name="requestTerminationBefore" …. /><operation name="destroy" …. /><sd:serviceData name="interface“…. /><sd:serviceData name="serviceDataName" …. /><sd:serviceData name="factoryLocator" …. /><sd:serviceData name="gridServiceHandle" …. /><sd:serviceData name="gridServiceReference" …. /><sd:serviceData name="findServiceDataExtensibility" …. /><sd:serviceData name="setServiceDataExtensibility" …. /><sd:serviceData name="terminationTime" …. /><sd:staticServiceDataValues> …..</sd:staticServiceDataValues>

</gwsdl:portType> OGSI ServiceDataの定義

<xsd:element name="GenericDiskDriveProperties"><xsd:complexType> <xsd:sequence><xsd:element ref="tns:NumberOfBlocks"/><xsd:element ref="tns:BlockSize" /><xsd:element ref="tns:Manufacturer" /><xsd:any minOccurs="0" maxOccurs="unbounded" />

</xsd:sequence> </xsd:complexType>

</xsd:element>…<!-- ResourcePropertyDocumentをポートタイプと関連つける --><wsdl:portType name="GenericDiskDrive"

wsrp:ResourceProperties="tns:GenericDiskDriveProperties" ><operation name="start" …/><operation name="stop" …/>…

</wsdl:portType>WSRF ResourcePropertyの定義

ResourcePropertyDocumentサンプル

<GenericDiskDrivePropertiesxmlns:tns="http://example.com/diskDrive" >

<tns:NumberOfBlocks>22</tns:NumberOfBlocks> <tns:BlockSize>1024</tns:BlockSize><tns:Manufacturer>DrivesRUs</tns:Manufacturer>

</GenericDiskDriveProperties>

WSRF GetResourceProperty

<wsrp:GetResourcePropertyRequestxmlns:tns="http://example.com/diskdrive">

tns:NumberOfBlocks</wsrp:GetResourcePropertyRequest>

<wsrp:GetResourcePropertyResponsexmlns:ns1="http://example.com/diskdrive" …>

<ns1:NumberOfBlocks>22</ns1:NumberOfBlocks></wsrp:GetResourcePropertyResponse>

……..<wsa:To soap:mustUnderstand="1">http://localhost/services/widgetService

</wsa:To><widget:ResourceID>12345</widget:ResourceID></soap:Header><soap:Body><wsrp:GetResourceProperty>

wsrl:TerminationTime</wsrp:GetResourceProperty></soap:Body>

</soap:Envelope>

WSRF SetResourceProperties

<wsrp:SetResourcePropertiesRequestxmlns:tns="http://example.com/diskdrive">

<wsrp:Update resourceProperty="tns:NumberOfBlocks"><tns:NumberOfBlocks>143</tns:NumberOfBlocks>

</wsrp:Update><wsrp:Delete resourceProperty="tns:Manufacturer" /><wsrp:Insert>

<tns:someElement>42</tns:someElement></wsrp:Insert>

</wsrp:SetResourcePropertiesRequest>

Sample QueryResourceProperties MessageContent-Type: text/xml; charset=utf-8SOAPAction: "http://www.ibm.com/xmlns/stdwip/web-services/WS-ResourceLifetime/QueryResourceProperties"Host: localhost<?xml version="1.0" encoding="utf-8"?><soap:Envelope

xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing"xmlns:wsrp="http://www.ibm.com/xmlns/stdwip/web-services/WS-

ResourceProperties"xmlns:widget="http://widgets.com">

<soap:Header><wsa:Action soap:mustUnderstand="1">http://www.ibm.com/xmlns/stdwip/web-services/WS-

ResourceProperties/QueryResourceProperties</wsa:Action><wsa:MessageID soap:mustUnderstand="1">uuid:00765982-76f1-41bd-9573-58ca18cee299</wsa:MessageID>

Sample QueryResourceProperties Message<wsa:To soap:mustUnderstand="1">http://localhost/services/widgetService</wsa:To><widget:ResourceID>12345</widget:ResourceID></soap:Header><soap:Body><wsrp:QueryResourceProperties><wsrp:QueryExpressionxmlns:wsrl="http://www.ibm.com/xmlns/stdwip/web-services/WS-

ResourceLifetime"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"dialect="http://www.w3.org/TR/1999/REC-xpath-19991116">boolean(/*/*[namespace-uri()='http://www.ibm.com/xmlns/stdwip/web-

services/WS-ResourceLifetime' and local-name()='TerminationTime']) </wsrp:QueryExpression></wsrp:QueryResourceProperties></soap:Body></soap:Envelope>

A

B

WS-Notification

Subscribe “A” to“SystemError”notifications only forSeverity = “1”

ConsumerTopicNotifyPrecondition

Consumer /Subscriber

A Producer

I sendnotifications on:- “goingOffLine”- “SystemError”

BConsumerTopicNotify

Subscribe “B” to“goingOffLine”notifications

Consumer WS-Notification Subscribe

NotificationProducer

Subscribe(ConsumerEndpointReference, TopicExpression, [UseNotify],[Precondition], [Selector], [SubscriptionPolicy], [InitialTerminationTime])

returns: WS-Resource qualified EPR to a Subscription

GetCurrentMessage(topicExpression)returns: a NotificationMessage (xsd:any)

Resource Properties for SubscriptionManager

<!-- SubscriptionManager specific --><xsd:element ref="wsnt:ConsumerReference" minOccurs="1" <xsd:element ref="wsnt:TopicExpression" minOccurs="1" <xsd:element ref="wsnt:UseNotify" minOccurs="1" <xsd:element ref="wsnt:Precondition" minOccurs="0" <xsd:element ref=“wsnt:Selector" minOccurs="0" <xsd:element ref="wsnt:SubscriptionPolicy" minOccurs="0" <xsd:element ref="wsnt:CreationTime" minOccurs="0"

Subscriber<wsnt:Subscribe>

<wsnt:ConsumerReference><wsa:Address>http://localhost/services/notifyReceiver</wsa:Address></wsnt:ConsumerReference><wsnt:TopicExpression dialect="http://www.ibm.com/xmlns/stdwip/

web-services/WS-Topics/TopicExpressiom/simple">widget:TestTopic</wsnt:TopicExpression><wsnt:UseNotify>true</wsnt:UseNotify></wsnt:Subscribe>

<wsnt:SubscribeResponse><wsnt:SubscriptionReference><wsa:Address>http://localhost/services/widgetSubMgr<wsa:Address><wsa:ReferenceProperties><widget:ResourceID>sub123</widget:ResourceID></wsa:ReferenceProperties></wsnt:SubscriptionReference></wsnt:SubscribeResponse>

Subscribe NotificationProducer

Consumer

A

B

Notify message1on “SystemError”to “A” Producer

Notify message1on “SystemError”to “A”,”B”,…..

Notify message1on “SystemError”to “B”

Consumer WS-Notification Notify

NotificationConsumer

Notify(NotificationMessage(TopicExpression, ProducerReference,

Message)*returns: n/a (one way)

NotifyNotificationConsumer

NotificationProducer

<wsnt:Notify><wsnt:NotificationMessage><wsnt:Topic>widget:TestTopic</wsnt:Topic><wsnt:ProducerReference><wsa:Address> http://localhost/services/WidgetService</wsa:Address></wsnt:ProducerReference><wsnt:Message>test message</wsnt:Message></wsnt:NotificationMessage></wsnt:Notify>

Resource Properties for NotificationProducer

<xsd:element name="NotificationProducerRP" ><xsd:complexType>

<xsd:sequence><xsd:element ref="wsnt:Topic"

minOccurs="1" maxOccurs="unbounded" /><xsd:element ref="wsnt:FixedTopicSet"

minOccurs="1" maxOccurs="1" /><xsd:element ref="wsnt:TopicExpressionDialects"

minOccurs="1" maxOccurs="unbounded" /></xsd:sequence>

</xsd:complexType></xsd:element>

WS-Topics

tns:T1 tns:T4

T2 T3 T5 T6

is alias for

Topic Space:“http://example.org/topicSpace/example1”

I sendnotifications on:- “goingOffLine”- “SystemError”

Subscribe “B” toreceive “SystemError”notifications

Consumer

B Y

X

Publisher

Publisher msg1

msg2

Publish “msg1” to“SystemError”

Publish “msg2” to“SystemError”

Subscriber

A

Broker

WS-Notification Broker

WS-ResourceProperties とWS-Notification

ResourcePropertyValueChangeNotification

<GenericDiskDrivePropertiesxmlns:tns="http://example.com/diskDrive" ><tns:NumberOfBlocks>22</tns:NumberOfBlocks><tns:BlockSize>1024</tns:BlockSize><tns:Manufacturer>DrivesRUs</tns:Manufacturer>

</GenericDiskDriveProperties>

<TopicSpace name=ResourcePropertiesTopicSpacetargetNamespace="http://example.com/diskDrive”>

<Topic name=“tns:NumberOfBlocks”.messageTypes=“wsrp:ResourcePropertyValueChangeNotification”

</Topic></TopicSpace>

Message Type of ResourcePropertyValueChangeNotification

<wsrp:ResourcePropertyValueChangeNotification><wsrp:OldValue> xsd:any </wsrp:OldValue>?<wsrp:NewValue> xsd:any </wsrp:NewValue>

</wsrp:ResourcePropertyValueChangeNotification>

Webサービスと

ビジネス・プロセスの統合

Webサービスの「統合」の技術的背景

テクニカルには、Webサービス間の複雑な相互関係を記述する必要が生まれている。

Webサービスのアーキテクチャが、単なる

RPCを超えて発展しつつあること

Document centricな処理モデルが、信頼

性の高い疎結合の「ビジネス統合」のメカニズムとして登場しつつあること

RPC Java<->XMLマッピング

引数のオブジェクト

XML

クライアントでのメソッド呼び出し

XML返り値のオブジェクト

Serialization

DeSerialization

XML

XML

引数のオブジェクト

返り値のオブジェクト

DeSerialization

Serialization

サーバでのメソッド呼び出し

HTTP

POST

Document Centric

RPC

XML

XML

XML InXML Out

XML Inside

XML

Business Processの記述

OrchestrationとChoreography

Web Services OrchestrationWebサービスの相互作用の実行順序を含む

プロセスのフローを記述する

プロセスは、常に一つの主体によってコントロールされる

Web Services Choreography

パブリックなメッセージの交換に関連していて、実行可能なプロセスには、直接関係しない

複数の主体を含んだメッセージのシーケンスを跡付ける

Orchestration : BPEL4WSBusiness Process Execution Language for

Web ServicesIBM, Microsoft, BEAが仕様策定

Choreography : WSCIWeb Services Choreography Interface

Sun, SAP, Intalio, BEAが仕様策定

OASIS Web BPEL TCIBM, Microsoft, BEA, Oracle, Sun, SAP

BPEL4WSBusiness Process Execution Language for

Web Services

http://www-106.ibm.com/developerworks/library/ws-bpel/

BPEL4WSとは?

複数のWebサービスをいかに結合して新しいWebサービスを提供するかを規定する

同じ言語が、実行可能なプロセスと抽象的なプロセスの双方を定義するために定義されている

実行可能なプロセスは、ワークフローを実行するのに必要なすべてのものを記述している

抽象的なプロセスは、メッセージ交換に基づいたワークフローに必要とされる観察可能な振る舞いを記述する(ビジネスパートナー間の契約の妥当性をチェックすることが出来る)

BPEL4WSとは?

基本的なWebサービスの活動をサポートする:invoke, receive, reply

Implicit lifecycle: ワークフローのインスタンスはメッセージが「スタート」とマークされワークフローエンジンに到達した時に生成される

BPELのActivityの例

Primitive Activities<receive> パートナーからのメッセージを待つ

<invoke> メッセージを発する

<reply> パートナーにメッセージを返す

……Structured Activities<sequence> 順番に実行する

<flow> 並行して実行する

<pick> メッセージに応じて一つを実行する

……..

WebService

WebService

Step1

Step2

Step3A

Step3B

<Receive>

<Reply><invoke>

<Sequence>

<Flow>

BPEL Structure

<process><!– Definition and roles of process participants --><partnerlinks> ... </partnerlinks><!- Data/state used within the process --><variables> ... </variables><!- Properties that enable conversations --><correlationSets> ... </correlationSets><!- Exception handling --><faultHandlers> ... </faultHandlers><!- Error recovery – undoing actions --><compensationHandlers> ... </compensationHandlers>

<!- Concurrent events with process itself --><eventHandlers> ... </eventHandlers><!- Business process flow -->

(activities)*</process>

BPEL4WSPartner Link Types

Partner Link Types<partnerLinkType name="purchasingLT">

<role name="purchaseService"> <portType name="purchaseOrderPT"/>

</role> </partnerLinkType>

<partnerLinkType name="invoicingLT"> <role name="invoiceService">

<portTypename="computePricePT"/> </role> <role name="invoiceRequester">

<portType name="invoiceCallbackPT"/> </role>

</partnerLinkType>

Roleが一つ

Roleが二つ

Partner Link Typeは、WSDL内に記述される

<portType name="purchaseOrderPT"><operation name="sendPurchaseOrder">

<input message="pos:POMessage"/> <output message="pos:InvMessage"/> <fault name="cannotCompleteOrder"

message="pos:orderFaultType"/> </operation>

</portType> <portType name="schedulingPT">

<operation name="requestProductionScheduling"><input message="pos:POMessage"/>

</operation> <operation name="sendShipingSchedule">

<input message="pos:scheduleMessage"/></operation>

</portType>

Request-Response

MEP

One-WayMEP

Request-Response MEP

One-Way MEP

WSDL Message Exchange Patterns

Partner Link Types invoicingLT

invoicingLT

invoiceService

Role Name

computePricePT

invoiceRequester

PortType NameinvoiceCallbackPT

<portType name="computePricePT"> <operation name="initiatePriceCalculation">

<input message="pos:POMessage"/> </operation> <operation name="sendShippingPrice">

<input message="pos:shippingInfoMessage"/> </operation>

</portType>

<portType name="invoiceCallbackPT"> <operation name="sendInvoice">

<input message="pos:InvMessage"/> </operation>

</portType>

Role: invoiceService

Role: invoiceRequester invoicingLT

Callback M

EP

One-WayMEP

Callback MEP

WSDL Message Exchange Patterns

Partner Link

<partnerLinks>…….<partnerLink name="purchasing"

partnerLinkType="lns:purchasingLT" myRole="purchaseService"/>

<partnerLink name="invoicing" partnerLinkType="lns:invoicingLT" myRole="invoiceRequester" partnerRole="invoiceService"/>

……..</partnerLinks>

Callback MEP

Partner Link invoicinginvoiceService

invoiceRequester

invoicing

Role Name

partnerRole

Partner Link TypeinvoicingLTmyRole

BPEL4WSサンプル

BPEL Variables<variables>

<variable name="PO" messageType="lns:POMessage"/>

<variable name="Invoice" messageType="lns:InvMessage"/>

<variable name="POFault" messageType="lns:orderFaultType"/>

<variable name="shippingRequest" messageType="lns:shippingRequestMessage"/>

<variable name="shippingInfo" messageType="lns:shippingInfoMessage"/>

<variable name="shippingSchedule" messageType="lns:scheduleMessage"/>

</variables>

WSDLのmessage節を参照する

<sequence><invoke partnerLink="invoicing“

portType="lns:computePricePT"operation="initiatePriceCalculation“inputVariable="PO">

</invoke><invoke partnerLink="invoicing"

portType="lns:computePricePT"operation="sendShippingPrice“inputVariable="shippingInfo">

<target linkName="ship-to-invoice"/></invoke> <receive partnerLink="invoicing"

portType="lns:invoiceCallbackPT"operation="sendInvoice" variable="Invoice"/>

</sequence>

InitiatePrice

CalculationDecide

On Shipper

InitiateProductionScheduling

ArrangeLogistics

CompletePrice

Calculation

CompleteProductionSceduling

ReceivePurchase

Order BPEL Sample

InvoiceProcessing

<sequence><receive partnerLink="purchasing" …/> <flow>

<sequence> <invoke partnerLink="shipping“….> <source …/> </invoke><receive partnerLink="shipping" …> <source …/> </receive>

</sequence> <sequence>

<invoke partnerLink="invoicing“ …/> <invoke partnerLink="invoicing“ …> <target …/> </invoke> <receive partnerLink="invoicing" …/>

</sequence><sequence>

<invoke partnerLink="scheduling“…/> <invoke partnerLink="scheduling" …> <target …/> </invoke>

</sequence> </flow> <reply partnerLink="purchasing" …/>

</sequence>

Gridとビジネスプロセスの統合

On Using BPEL Extensibility to Implement OGSI and WSRF Grid Workflows

Aleksander Slomiski

January 25th, 2004

BPELを使って、WebサービスとGridを

統合させようという試み

BPEL4WS を利用する

BPEL1.1との互換性

BPEL1.1のサンプルが一切変更なしで実行でき

ること

WS-RF (あるいはOGSI)とのシームレスな統合

GridBPELWebサービス

ComponentServices

(Create, Connect)

CoG Services(security, GridFTP)

Pub/SubMessaging

Grid Services (Grid Partners)

Receive

InvokeInvoke

Reply

Web Service

WSRFService

Another BPELProcess

Web Services (Partners)

BPELによるWebサービスとGridの統合

BPEL と OGSI との統合

・ BPELの抽象を利用する

‐ BPELのパートナーはインターフェース (PortType)によって知られる

‐ 非常に強力な統合のメカニズムである

・ GSH/Locatorを素朴にサービスへの参照として理解する

‐ GSHからGSRへの自動変換をする

・ 明示的にも、黙示的にもライフサイクルの管理をサポートする

‐ GPEL ワークフローエンジンは、OGSIのファクトリーでもある

OGSIとの統合の難しさ

• GSH/GSRとWS-Addressingの問題‐ エンドポイントリファレンス (EPR)は GSH でも GSRでも

ない …

‐ セマンティックスの違い: EPR にはWS-Policy,がある

• BPEL とOGSI Factoryの問題‐ BPELエンジンはファクトリとして機能する

‐ BPELは黙示的な生成モデルをすでに持っている

• OGSIファクトリではないBPELエンジンの問題‐ 通常のOGSIの利用パターンと合致しない

‐ OGSIファクトリはオプショナルである …

BPELとWS-RFとの統合

• WS-Addressing (WSA)‐ ワークフローのインスタンスの同定に利用

・ WSA はすでにBPELに使われている…‐ 変換の必要がない

・ WS-Resource properties‐ OGSIのSDEによく似ている

・ WS-Notification‐ ワークフローの状態の監視に利用できる

WS-Addressing利用の利点Synchronous vs. Asynchronous

・ <receive/> <reply/>

‐ 典型的なバインディングはSOAP/HTTP

・ WS-Addressing の<ws:ReplyTo/>を使う

‐ ユーザは帰りのアドレスを指定できる

‐ Receiveコネクションは一つでよく、すぐクローズできる

‐ Replyは実行できる

Slomiskiの結論

・ BPELはGridでの動作に適合できる‐ しかし、適合には多くのレベルがある…

・ OGSI/WSRFを超えた問題がある‐ 巨大データとストリーミングのサポート

‐ フォールトとエラーリカバリーの処理

‐ ワークフローのモニターリングと管理

‐ ワークフローのデプロイメント

‐ セキュリティ

‐ …

GridでのBPEL利用の課題

I Undiana niversityExtreme! Lab

二つの可能なアプローチ

BPELの拡張はしない。デプロイメントがBPELの一部ではないことを利用する‐ OGSIは難しいが、WS-RFは容易で実証済み。こ

れで十分かもしれない。

‐ 短期的な観点からのアプローチ

モニタリングや生存時間管理をサポートするBPELプロファイルを作る‐ こうした「拡大された」BPELワークフローは、特別

の実行環境を必要とする

‐ 長期的な視点からのアプローチ

残されている課題

・ ワークフロー・モニタリング

‐ XMLで表現される状態はいくつ必要か?

‐ フィルターの共通のフレームワークが必要

・ WS-Notification Topics?

・ フォールト・トレランス

‐ 代わりのサービスの選択

‐ 予期しない例外の扱い

・ 巨大なデータとストリーミングのサポート

‐ BPELでの適切なメタファー

Very Long Running Processes

あるプロセスは短命だが、あるものはそうではない

長時間実行のシミュレーション

繰り返し計算

永続的な探索

ワークフローエンジンはホストのリスタートも生き抜くことが出来なければならない

全ての状態はデータベースに蓄えられる

WS-ReliableMessagingを利用する

ワークフローのレベル

マシンの内部

ファイアウォールの内部

「仮想的な組織」の内部

さらにそれをレベルアップした、複数の「仮想的な組織」をまたいだワークフロー

J2EEとビジネスプロセスの統合

Java Business IntegrationJSR208

N.Kassem TS3740.pdfM.Hapner JA-SIG-12-08-Keynote.pdf

WhitePaper JBIwp70903.fm.pdf

Java Business Integration

Java プラットフォームをSOAで拡大したもの

サービス間の組み合わせ

サービス内部の組み合わせ

JBI アプリケーションは、統合コンポーネントの組み合わせ

標準的なパッケージングとデプロイのモデル

Java Business Integration

プラットフォームを拡大するための一群のSPI(システムプログラムインターフェース)の集まり

ビジネス・プロセス・エンジン(Machine SPI)

ビジネス・プロセス・マシンの為の標準的な実行環境を整備する

バインディング・フレームワーク(Binding SPI)

外部のサービスとデータを交換するための拡張可能なプロトコルバインディングのセットをコンテナに提供する

メッセージをプロトコルバインディングに関連付ける

J2EE with JBI

・ 拡大可能な統合プラットフォーム

・ 多くのコンポーネント・モデル

・ 多くのバインディング

・ すべてがWSDL MEPsと、組み合わせのメカニズムを共有する

Request-Response MEP One-Way MEP

Callback MEP

WSDL Message Exchange Patterns

JBI, System View

SOAP

EDI MoM

Business System A Business System C

Business System B

JBI, Process View

Normalized Message “Bus”

BindingFramework

Business Process Machines (BPM)

・ BPMは、「ビジネス・プロセス・インスタンス」

をサポートし、その生存サイクルを管理する

・ BPMは、「正規化されたメッセージ」のレベル

で機能する

・ 「正規化されたメッセージ」という概念は、ビジネスメッセージを効率的に処理する上で重要な役割を演ずる

• JBIは、BPMと正規化されたメッセージバスと

の間の取り決めを形式化したもの

JBI and J2EE

208 “Machine”SPI

Normalized Message “Bus”

208 “Binding”SPI

SOAP MQ EIS resource AS1/AS2

JBI Container Model

まとめ

WebService

BusinessProcess

Integration

GridOGSA/WSRF

Grid

GridOGSA/OGSI

WebサービスとGrid

WebService

WebWebサービスとJ2EEの発展

J2EE

BusinessProcess

IntegrationJ2EE1.4

J2EEJBI

Grid,WebサービスとJ2EE

BusinessProcess

Integration

J2EEJBI

GridOGSA/WSRF

WebService

Recommended