Devilish Web Services Composition and Orchestration Engine

Click here to load reader

  • date post

  • Category


  • view

  • download


Embed Size (px)


Devilish Web Services Composition and Orchestration Engine. Students: Flavio Palandri antonelli Alessandro Porfiri. “Seminars in Software Engineering” course’s project 2007/2008 Professor Giuseppe De Giacomo. Web Services. - PowerPoint PPT Presentation

Transcript of Devilish Web Services Composition and Orchestration Engine

  • Devilish Web Services Composition and Orchestration EngineStudents:Flavio Palandri antonelliAlessandro PorfiriSeminars in Software Engineering courses project 2007/2008Professor Giuseppe De Giacomo

  • Web ServicesSoftware modules designed to support interaction between heterogeneous systems in a network or in internet

    public interface description of available operationStandard communication protocols Interaction via standard messages Great diffusion of Web Services systemsMany functionalities already implemented and available

  • Scenario Web Services CompositionClientService requestCommunityService 1Service nmappingService 2mappingmappingA client requires a TARGET service to be implementedAll functionalities are already implemented in other AVAILABLE SERVICESIdea: we could realize the TARGET service combining Availables

  • ObjectivesAnalyzing Services Composition Problem from a theoretical point of viewStudying Web Services technologiesUnderstanding tools already implemented to build automatically the compositionWSCETLVDevelopment of a tool able to manage the whole processBuild CompositionGenerate and publish Target ServiceManage the orchestration of services

  • Abstract services rapresentation We need to abstract from service implementationWe rapresent only the service behavior TRANSTION SYSTEM

  • Composition actors Available ServicesExisting servicesRapresented by TSWe will consider also non deterministic behaviorTargetIs the service requested by the clientRapresented by TSOnly deterministicOrchestratorThe composition manager

  • Composition

  • Who is orchestrator?

  • Build composition1.Enconding the condition:

    in a PDL formula and checking its satisfability

    2.Via SimulationCan we reproduce Targets behavior with any one Available Services combination?

  • Simulation The Community

  • Simulation Relation

  • Simulation Algorithm

  • Composition via simulation

  • Composition via simulationComposition exists iff Simulation exists

  • OG the Orchestrator Generator

  • Non deterministic behavior

  • Simulation with nondeterminism

  • OG with nondeterminism

  • TLV A tool for computing compositionTemporal Logic VerifierLTL basedComputes composition via simulation indirectlyAutomatically computes the OG if realizable

  • TLV / 2Target + Communityfile smw

  • TLV / 3Simulation constraints:

  • TLV /4If composition is realizable TLVs output is the OG

  • How to create smw file?WSCE (web service composition engine) its like a wrapper for TLV

    Creates smw file from target and available services TS descriptions Execute TLV on smw file From TLV result produce sql script to store the OG table into a DBWSCETLVTS descriptionsWSTSLOG tableScript sql

  • WSCE /1 - InputTS of target and services are described with the xml language WSTSL

  • WSCE /2 - OutputOG Table one for each composition caseWSCE produce also NEXTSTATE[source, target] tableGiven in_act, Tstate and Si_statesNow, we just need to develop a tool able to manage the orchestration using this table

  • DIGRESSION WS technologiesWeb services are software systems offering operations to remote clientsAvailable operations are described through the service interface WSDLClients communicate with service via SOAP messages on HTTP protocol

    Example of a Java Web Service

  • DIGRESSION - AxisAxis is a open source tool forpublishing web services (in this way software modules become WS)Managing clients interaction with WS (request/response)It runs in a web container (Tomcat)To publish a service Axis needs Class files and the services descriptor file WSDD Service nameService classService methodsConversation: Session = statefulRequest = statelessApplication = singletonPublishing using command java adminClient login.wsdd

  • DIGRESSION Service InterfacePublishing the service, axis produce the service interface WSDL with all informations of service needed by clientsService name and addressMethodsOutput parameterInput parametersComplexType (any non standard Object managed by the service, example Person, Product, Order...)

    WSDL are always accessible, to build the WS Target we will need all Available Services WSDL.

  • Our part in this projectWe want to complete the whole composition and orchestration process, developing missing elements

    Orchestrator: a tool able to manage requests from Target Service, finding and delegating the operation to the right Available Service, using informations stored in the OG Table produced by WSCE. Basically Target will demand all client requests to the orchestrator

    TargetGenerator: a direct extension of WSCE, reading OG and Available Service WSDL produces and publishes the Target Web Service on Axis

  • Orchestrator /1 General ScenarioImplementation of orchestrator program P(h,a) = i, and even more

    Client invokes Target operationTarget demands client operation request to the orchestratorThe Orchestrator access OG Table to find the index of the Available Service able to resolve the operationThe Orchestrator invoke the operation to selected service Result is returned to client through Target Service.

    To get the index of available service from the OG, the orchestrator needs:Requested action Target stateAll Available Services states

  • Orchestrator /3 Services statesIs orchestrator able to retrieve the status of services?

    Target State: Yes alwaysTarget is deterministicOrchestrator can get Target initial state from OG TableAt each step the orchestrator can get the new TargetState given Input Action and Orchestrator State using the NEXTSTATE tableAvailable Services states: dependsDeterministic: yes it could easily retrieve it from the OG TableNon deterministic: No, orchestrator must query all AS to retrieve their status

    Available Services have to manage their statusThey must offer a int getStatus() remote operationConnection with between Orchestrator and all services must be stateful

  • Orchestrator /2 Architecture - Unique component for every target (reuse) - An instance of orchestrator for each target - Orchestrator must be able to manage requests from Concurrent Clients

  • Orchestrator /4 Composition infosOrchestrator is indipendent from composition caseThe component must be usable from any targetTarget has to initialize his own orchestrator with composition infos:Name of OG tableList of avalable service Service index Service name Service addressComplex type classes list

  • Orchestrator /5 InitializationOrchestrator Initialization:Receives all informations from TargetFor each Available Service establish a stateful connection: Call, mantained during the whole conversation with that clientRegisters all ComplexTypes classesOperation invocationUsing Calls to retrieve states from servicesUsing Call to invoke operation to selected service

  • Orchestrator /6 ConcurrencyEach Client has a Session with an instance of WS targetEach Target has instance of orchestratorEach Orchestrator has a Session with every available services.

    This way Concurrency is guaranteed

  • Orchestrator /7 OP invocationInitialization: only for the first invocation

    Operation invocation

  • Orchestrator /8 Implementation

  • Orchestrator /9 DistributionDistributed as libraryTargets generated automatically are already made to use this libraryUser can also build manually their own Target using Orchestrators API

  • Target Generator /1How do we build the Target Service? User can make the java class, publishing it manually User can use the TargetGenerator to build it in 1 minute

    INPUT OG script provided by WSCE WSDL files one for each available service

    OUTPUT Target web service published on Axis ready to receive requests OG Table stored in Mysql DB

  • Target Generator /2 OperationsTo register a service Axis needs class file of target service, wsdd file, class files of ComplexType

    Creates java file of target and complextypes (ex person, product) Compiles all files Creates wsdd of target Publishes target service on Axis using AdminClient

  • Target Generator /3 The whole process

  • Target Generator /4 Class SchemaTarget must import orchestrator.jarClass header, class name is taken from inputGlobal variable of the Orchestrator ConstructorPrepare all informations needed for compositionOG tablenameArray of ServiceInfo (name, address) //index is cabled in the array structureList of ComplexTypes classesOrchestrator = new Orchestrator(tablename, serviceInfos, complexTypes)Sequence of dummy methods representing remote operations of ServiceMethod headerOutput parameterInput parametersOperation demanded to orchestrator, orchestrator.invoke(op)Result returned to client

  • Target Generator /5 ArchitectureAll informations needed are retrieved from WSDL files of Available Services using WSDLParser

  • Target Generator /6 Execution flow

  • Target Generator /7 init DataTarget Generator parses WSDL of Available Services to retrieve composition infosServices name, addressComplexTypesMethods

  • Running ToolsExample 1 Test1ND: a Web Service to listen songsExample 2 MediaStore: tipical E-Commerce application with interactive client

    Other example can be found on the documentation

  • TSExample Test1ND

  • Example of WSTSLExample Test1ND

  • Java file of servicepackage test1NDCommunity;public class SearchByAuthorND{int stato = 0;public String SearchByAuthor(String author) throws Exception{if(stato != 0){ throw new Exception("Service is not able to execute this operation in this state"); } String canzone = "";if(!author.equals("Paul")){stato = 1;canzone = "yesterday";}else{//ND the service doesn't work with input Paul, keep state 0canzone = "NOT FOUND";}return canzone; } public String Listen(String name)throws Exception{ if(stato != 1){ throw new Exception("Service is not able to execute this operation in this state"); } stato = 0; return name+"...yesterday, all my troubles seems so far away..."; } public int getStatus(){ return stato; }} Example Test1ND

  • Example of WSDDExample Test1ND

  • After published all serviceUser has to download WSDL of Available Service to prepare the wsdl directory

    1 Execute WSCEC:\wsce-lite-dist_0.1>java -jar wsce.jar test1ND

    2 Generate targetC:\wsce-lite-dist_0.1>java -jar targetgenerator.jar test1nd

    3 Execute clientC:\wsce-lite-dist_0.1\Composizioni\test1ND\services\

    Example Test1ND

  • Another example - TSExample MediaStore

  • Example of WSTLExample MediaStore

  • Example of WSDD with complex typeExample MediaStore

  • Java file of an Available ServiceExample MediaStore

  • Java file of complex typeExample MediaStore

  • After published all servicejava org.apache.axis.client.AdminClient .wsdd

    1 Execute WSCEC:\wsce-lite-dist_0.1>java -jar wsce.jar MediaStore

    2 Generate targetC:\wsce-lite-dist_0.1>java -jar targetgenerator.jar MediaStore

    3 Execute clientC:\wsce-lite-dist_0.1\Composizioni\MediaStore\services\

    Example MediaStore

  • Target createdExample MediaStore

  • Conclusions

    Users can build their Target Service in 5 minutes componing existing servicesBuild Target manually using orchestrators APIBuild Target automaticallyComplexTypes are managedThe whole orchestration process is now completely workingClient concurrencyTarget itself may be an Available Service for another case of CompositionProblemsAvailable Services have to manage their state and offer the getStatus operationWe could spread in internet a Componible interface to be implementedExtensionsIntergration of WSCE and TargetGeneratorThe tool should be accessible remotely, with user friendly interfaceExtension to RMI services