soa unit ii

110
UNIT - II Web services Service descriptions Messaging with SOAP Message exchange Patterns • Coordination Atomic Transactions Business activities • Orchestration • Choreography Service layer abstraction Application Service Layer Business Service Layer Orchestration Service Layer

Upload: sivakumar

Post on 16-Aug-2015

224 views

Category:

Documents


2 download

DESCRIPTION

anna university

TRANSCRIPT

UNIT - IIWeb services Service descriptions Messaging with SOAP Message exchange PatternsCoordination Atomic Transactions Business activities Orchestration Choreography Service ayer abstraction Appication Service !ayer Business Service !ayer Orchestration Service !ayerWEB SERVICES SERVICES (AS WEB SERVICES):Definition " #Web$based appications that dynamicay interact with other Webappicationsusingopenstandardsthatincude%M!& '(() and SOAP*#AService$OrientedArchitecture+SOA,isacoectiono- servicesorso-twareagentsthatcommunicate-reeywith each other*#A Web service is a so-tware appication identi-ied by a '.)& whose inter-aces and bindingare capabe o- being de-ined& describedanddiscoveredby%M!arte-actsandsupports directinteractionswithotherso-twareappicationsusing %M! based messages via internet$based protocosCurrent distributedinfrastructureMicrosoft:#DCOM/COM+SUN:#Jaa RMICORBA:#!r" to #e a stan$ar$ s%ecification ( #&t co'%(e) to &se)DisadvantagesVen$or S%ecific*(atfor' S%ecificNo intero%era#i(it"Confi+&rin+ ,ire-a((sAccording to the SOAA We# serice is:#Aninter-acethatdescribesacoectiono-networ/ accessibe operations# (escribed using a service description anguage#Pubishedbyma/ingthisservicedescriptionavaiabeto users#0oundbysending1ueriestoaregistrymatchingservice descriptions# Bound$)nvo/edby using the in-ormation contained in the service description#Composedwithotherservicestocreatenewservices +service orchestration,Fundamentally,everyWebservicecanbe associated with:atemporaryclassificationbasedontherolesit assumes during the runtime rocessing of a messageapermanentclassificationbasedonthe application logic it rovides and the roles it assumes within a solution environmentWee!lorebothofthesedesignclassifications in the following two sections:service roles "temorary classifications#service models "ermanent classifications#SERVICE RO.ES: #AWebserviceiscapabeo-assumingdi--erentroes&dependingon the context within which it is used* 0or exampe& a service can act as the initiator& reayer& or the recipient o- a message* #The -undamenta service roesare Service provider#Service requestor#Intermediaries #Initial sender and ultimate receiver#Service compositions#Service providerThe service provider role is assumed by a Web service under the following conditions:#The Web service is invoked via an external source, such as a service requestor #serviceproviderentity(theorganizationorindividual providing the Web service)#serviceprovideragent(theWebserviceitself,actingasan agent on behalf of its owner)Figure shows therecipient of a request message, the Web service is classified as a service provider. Service requestor ( Service onsumer ! # Anyunito-processingogiccapabeo-issuingare1uest messagethatcanbeunderstoodbytheserviceprovideris cassi-ied as a service re1uestor* # The Web service invo/es a service provider by sending it a message*# Aservicere1uestorcanrepresentboththeWebservice itse- as we as the Web service owner # sericere/&estorentit"+theorgani2ationorindividua re1uesting the Web service,# sericere/&estora+ent+theWebserviceitse-&actingas an agent on beha- o- its owner,"igureThe sender of the request message is classified as a service requestor. Intermediaries:# Webservicesandserviceagentsthatrouteandprocessa messagea-teritisinitiaysentandbe-oreitarrivesatits utimatedestinationarere-erredtoasintermediariesor intermediaryservices*Becauseanintermediaryreceives and submits messages& it aways transitions through service provider and service re1uestor roes*# There are t-o t"%es of inter'e$iaries" *assie inter'e$iar" #ctive intermediaries 0igure shows the intermediary service transitions through service provider and service re1uestor roes whie processing a message* The-irst&/nownasa%assieinter'e$iar"&istypicay responsibe-orroutingmessagestoasubse1uentocation*)t mayusein-ormationintheSOAPmessageheaderto determinetheroutingpath&oritmayempoynativerouting ogic to achieve some eve o- oad baancing Figure 5.6. A passive intermediary service processing a message without altering its contents. #n active intermediaries aso route messages to a -orwarding destination*Priortotransmittingamessage&however&these services activey process and ater the message contents*0igure shows an active intermediary service* Initial sender and ultimate receiver# Initia(sen$ersaresimpyservicere1uestorsthatinitiate the transmission o- a message* There-ore& the initia sender is aways the -irst Web service in a message path* # The&(ti'atereceieridenti-iesserviceprovidersthat exist as the ast Web service aong a message3s path0igure Web services acting as initia sender and utimate receiver Service compositions (service assemblies !# )tcompositereationshipbetweenacoectiono-services*There-ore&each servicethatparticipatesinacompositionassumesanindividuaroeo- service composition member 0igure A service composition consisting o- -our members Theconcepto-servicecomposabiityisveryimportanttoservice$oriented environments* S4.5)C4 MO(4!S" # Themannerinwhichservicesarebeingutilizedinthereal world, though, has led to a classification based on the nature of theapplicationlogictheprovide,aswellastheirbusiness!relatedroleswithintheoverallsolution.Theseclassifications are "nown as service models.# The basic set of common service models. $usiness service model %tility service model ontroller service modelB&siness serice 'o$e( :# #tencapsulatesadistinctsetofbusinesslogicwithina well!definedfunctionalboundar.#tisfull autonomous *# Business services are used within SOAs as -oows"6 as -undamenta buiding boc/s -or the representation o- business ogic6 to represent a corporate entity or in-ormation set6 to represent business process ogic6 as service composition members Uti(it" serice 'o$e(# Any generic Web service or service agent designed -or potentia reuse can be cassi-ied as a utiity service*# 'tiity services are used within SOAs as -oows" as services that enabe the characteristic o- reuse within SOA as soution$agnostic intermediary services as services that promote the intrinsic interoperabiity characteristic o- SOA as the services with the highest degree o- autonomy Contro((er serice 'o$e(# Contro((er serices are &se$ -it0in SOAs as fo((o-s: to support and impement the principe o- composabiity to everage reuse opportunities to support autonomy in other services 7ote that controer services themseves can become subordinate service composition members*"igure shows a service composition consisting of a master controller& a sub'controller& four business services& and one utility service( SERVICE DESCRI*!IONS (WI!1 WSD.)The Web Services (escription !anguage +WS(!, is the most -undamenta technoogy standard associated with the design o- services*WS(!de-initionsareacentraparto-aaspectso-service design*)t consist o- two de-initions &Abstract de-initionConcrete de-initionThe a#stract $efinition contains a series o- parts that incude types&message&andporttype+orinter-ace,&whereasthe concrete $efinition is comprised o- binding and service parts*WSD. an$ SOA :#Thecreationo-WS(!de-initionsisanimportantparto- the SOA deivery i-ecyce* #8ey design issues o- WS(! are &Standardi)eduseofnamespaces'$sestandardname space wsdl specification *odularservicedefinitions'W%&'supportsthe capabilitforservicedefinitionstobecomposed(for reuse and centralized maintenance ) ompatibilityofgranularity'%erviceinterface granularitideallcorrespondsto*+'document granularitSerice en$%oints an$ serice $escri%tions : #AWS(!describesthepointo-contact-oraservice provider&aso/nownastheserviceendpointor9ust endpoint*)tprovidesa-ormade-initiono-theendpoint inter-aceandasoestabishesthephysicaocation +address, o- the service*#A WS(! service description +aso /nown as WS(! service de-initionor9ustWS(!de-inition,canbeseparatedinto two categories"abstract descriptionconcrete description0igureWS(! document consisting o- abstract and concrete parts that coectivey describe a service endpoint A#stract $escri%tion : # Anabstractdescriptionestabishestheinter-ace characteristics o- the Web service without any re-erence to thetechnoogyusedtohostorenabeaWebserviceto transmit messages* # !0ree 'ain %artsare & portType! a high!level view of the service interface +peration ! ,ach operation represents a specific action performed b the service. *essage!Therefore,anoperationconsistsofasetof input and output messages Concrete $escri%tion:# Theexecutiono-serviceappicationogicawaysinvoves communication& the abstract Web service inter-ace needs to beconnectedtoaphysicatransportprotoco*This connection is de-ined in the concrete description portion o- the WS(! -ie& which consists o- t0ree re(ate$ %arts" $inding!describestherequirementsforaserviceto establish phsical connection+ e+2 SOA* , ,ort ( end point ! - #t represent the phsical address at which a service can be accessed with a specific protocol. Service-#tisusedtorefertoagroupofrelated endpoints. Meta$ata an$ serice contracts: Meta$ata :# 4acho-thesethree+WSD.$efinition34SDsc0e'aand %o(ic",servicedescriptiondocumentscanbecassi-iedas serice 'eta$ata& as each provides information about the service* Serice Contracts :# .setofconditionsthatmustbemetandacceptedba potentialservicerequestortoenablesuccessful communication*"igure# service contract comprised of a collection of service descriptions and possibly additional documents( Se'antic $escri%tions: # The most chaenging part o- providing a compete description o- a Web service is in communicating its semantic 1uaities*# 4xampes o- service semantics incude" how a service behaves under certain conditions how a service wi respond to a speci-ic condition what speci-ic tas/s the service is most suited -or Serice $escri%tion a$ertise'ent an$ $iscoer": # These repositories aow humans +and even service re1uestors, to" ocate the atest versions o- /nown service descriptions discover new Web services that meet certain criteria *riate( O-n or+n2)an$ %(ic( an" Or+n2) re+istries# Service descriptions can be dynamicay discovered by humans or appications& using private or pubic service registries*"igureService description locations centrali)ed in a registry( $inding templates and t*odels# .egistry records -oow the same ogic in that they store binding in-ormation in a separate area& caed the #in$in+ te'%(ate*# The tMo$e( section o- a '(() record provides pointers to actua service descriptions WS(! 4ements# The definitions eement This is the root or parent eement o- every WS(! document* + contains service de-inition : ocation ,0or 4xampe&;de-initions name>schemas*xmsoap*org>wsd>= ;>de-initions? # The tpes eement The types construct is where %S( schema content is paced* to represent the %M! content o- message bodies 0or exmape& ;>schema? ;compexType namese1uence?;>compexType? ;>schema? # The message and part eements 0or every message a service is designed to receive or transmit& a message construct must be added* This eement assigns the message a name and contains one or more part chid eements that each are assigned a type 0or 4xampe & ;'essa+e name%(an B> (a co'%ensation)2B&siness actiit" %rotoco(s)t provides two very similar protocols& each o- which dictates how a participant may behave within the overa business activity*#The B&sinessA+ree'entWit0*artici%antCo'%(etion %rotoco(& which aows a participant to determine when it has competed its part in the business activity*#The B&sinessA+ree'entWit0Coor$inatorCo'%(etion %rotoco(& which re1uires that a participant rey on the business activity coordinator to noti-y it that it has no -urther processing responsibiities*!0e #&siness actiit" coor$inator#Whenitsprotocosareused&theWS$Coordination controerserviceassumesaroespeci-ictothe coordination type in this case it becomes a business activity coordinator ,i+&re!0e #&siness actiit" coor$inator serice 'o$e(B&siness actiit" states#(uring the i-ecyce o- a business activity& the business activity coordinatorandtheactivityparticipantstransitionthrougha series o- states# co'%(ete$ notification Aparticipantcanindicatethatithascompetedthe processing by an activity * #This moves the participant -rom an actie state to a co'%(ete$ state* #Co'%(ete$ State : participant /now that the business activity is being success-uy competed*#Participants can enter aco'%ensation state during which they attempt to per-orm some measure o- exception handing* #)t is a separate compensation process that coud invove a series o- additiona processing steps*A cance((e$ state can be entered* This typicay resuts in the terminationo-any-urtherprocessingoutsideo-the canceation noti-ications that need to be distributed*Ane)itstatebyissuinganexitnoti-icationmessagetothe business activity coordinator*B&siness actiities an$ ato'ic transactions)tisimportanttonotethattheuseo-abusinessactivitydoes notexcudetheuseo-atomictransactions*)n-act&itisi/ey thataong$runningbusinessactivitywiencompassthe execution o- severa atomic transactions during its i-etime0ig* Two atomic transactions residing within the scope o- a business activityB&siness actiities an$ SOAThroughtheuseo-thecompensationprocess&business activities increase SOA3s 1uaity o- service by providing buit$in -aut handing ogic*,i+&reA #&siness actiit" re(atin+ to ot0er %arts of SOAORC1ES!RA!ION)nthesesystems&acentraycontroedsetofwor"flowlogicfacilitates interoperabilitbetweentwoormoredifferentapplications*Acommon impementationo-orchestrationisthe0:an$:s%o