vptaps@gmail.com @johnxavierv—twitter prathapkumarvemula@facebook.com http://www.slideshare.net/xavierjohn4 07775991224 First Example in SOA usingBPEL Simple example,itprocessthe subjectdetailsandfinallysendsbackgrade asresponse. here isthe explanationof applicationstepbystep. Step1: clientsendingthe subjectdetails(s1,s2,s3,s4,s5) Step2: we have to readthe clientdata fromexposedservice,thenwe needto passsame data to external reference "total"operation. Step3: outputfrom"total"operationisinputto"avg" operation Step4: outputfrom"avg" operationisinputto"grade"operation. Step5: Outputfrom"grade"operationwe needtosendbackto client. for doingabove process we have tohave followingcomponents/Services.  ExposedService - Entrypointformy application  External reference- toconsume someone providedservice  BPEL - to do integrationof ExposedService andexternal reference. inthisapplicationwe are usingfollowingBPELActivities.  Receive - toread the data fromexposedservice  Reply - to sendresponse back  Invoke - to call external reference operation(foreachoperationwe have touse one Invoke Activity)  Assign- to transferdata betweenone variable toothervariable. inthiscurrent example myprocessstartswith"receive"activityandendswith"reply"activity.in betweenwe are having3Invokesfor3 operations, andmultipleassignactivitiestotransferthe data. and the BPEL shouldlooklike bellow.
vptaps@gmail.com @johnxavierv—twitter prathapkumarvemula@facebook.com http://www.slideshare.net/xavierjohn4 07775991224 Variables Receive - itcontainsonlyone Variable,thatisinputvariable. Reply - it containsonlyone variable,thatisoutputvariable. Invoke - itcontainstwo variables,inputandoutput. nowwe will see creationof firstapplicationstepbystep.Aftercreationof Projectwe have toopen composite.xml file,nowwe needtodofollowingprocess Step 1 : we have to create external referencebasedon URL. forcreatingexternal reference drag "WebService"adapterfrom"ComponentPalette" ->"ServiceAdapters"anddropin"External Reference"area.
vptaps@gmail.com @johnxavierv—twitter prathapkumarvemula@facebook.com http://www.slideshare.net/xavierjohn4 07775991224 once we drag and drop itopensthe followingpopup,here we have toprovide the "name",value for "WSDL URL" and thenclick"tab".if you wantto copy the artefactsrelatedto "WSDL URL" selectthe option"copywsdl and its dependentartefactsintothe project"(thisisoptional).andthenclickon "Ok". it leadstofollowingpopup,inthisClickon "Ok".Thispopupwill be seenonce we selectthe check box " copy wsdl andits dependentartefactsintothe project".
vptaps@gmail.com @johnxavierv—twitter prathapkumarvemula@facebook.com http://www.slideshare.net/xavierjohn4 07775991224 Step2 : nowwe needto create exposedService,forcreationof exposedService,we needcome up withXSD.for eachoperationinservice we needtocreate twoelements,one requestandone response element.if myservice contains10operationswe have tocreate 10*2=20 elements. As perout requirement, ourinputelementcontainssubjectdetailsand outputelementcontain grade details.XSDshouldlooklike bellow. creation of XSD - rightclickon "XSD" folderinproject ->"All Technologies" ->"XML"-> "XML Schema"and clickon "Ok"
vptaps@gmail.com @johnxavierv—twitter prathapkumarvemula@facebook.com http://www.slideshare.net/xavierjohn4 07775991224 it leadstofollowingpopup,here provide the name of XSDasyou wishandclickon "Ok". it creates"sample.xsd"( Iprovidedname assample.xsd) inxsdfolder.now create the elements basedon yourrequirement. followingisthe source code forthisapplication <?xml version="1.0"encoding="windows-1252"?>
vptaps@gmail.com @johnxavierv—twitter prathapkumarvemula@facebook.com http://www.slideshare.net/xavierjohn4 07775991224 <xsd:schemaxmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.example.org" targetNamespace="http://www.example.org" elementFormDefault="qualified"> <xsd:elementname="input"> <xsd:complexType> <xsd:sequence> <xsd:elementname="s1"type="xsd:int"/> <xsd:elementname="s2"type="xsd:int"/> <xsd:elementname="s3"type="xsd:int"/> <xsd:elementname="s4"type="xsd:int"/> <xsd:elementname="s5"type="xsd:int"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:elementname="output"> <xsd:complexType> <xsd:sequence> <xsd:elementname="grade"type="xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema> nowusingthisXSD,we needtocreate "ExposedService",forcreating"ExposedService"we needto drag "WebService"adapterfrom"ComponentPalette" ->"Service Adapters"anddropin"Exposed Service"area. it leadstofollowingpopup,here we needtoprovide "name",andclickon"Generate WSDLfrom schema(s)"
vptaps@gmail.com @johnxavierv—twitter prathapkumarvemula@facebook.com http://www.slideshare.net/xavierjohn4 07775991224 it leadstofollowingpopup,here we needtoselect"Interface Type",we have three typesof interfaces.  SynchronousInterface  AsynchronousInterface  One-WayInterface Basedon requirementwe willchoose one of the above. nowi am goingwithSynchronousInterface.we needtoselectinputandoutputelements.clickon "+" icon to selectinputandoutputelements.
vptaps@gmail.com @johnxavierv—twitter prathapkumarvemula@facebook.com http://www.slideshare.net/xavierjohn4 07775991224 it leadstofollowingpopup, here we needtoselectbrowse forschemafiles,toselectinputand outputelements. it leadstofollowingpopup,here we needtoselectinputelementfrom"ProjectSchemaFiles" -> "sample.xsd"->"input" we needtorepeatabove processforoutputelementalso.aftercompletionitlookslike bellow
vptaps@gmail.com @johnxavierv—twitter prathapkumarvemula@facebook.com http://www.slideshare.net/xavierjohn4 07775991224 thenclick on "Ok"and againclick on"Ok". Step3 : Nowdrag BPEL componentfrom"Service Components"anddropin"Component"area. select"BPEL2.0 Specification",provide aname as youwish(inthisexample i amgoingwithdefault name),selectTemplateas"Define Service Later",andclickon"Ok"
vptaps@gmail.com @johnxavierv—twitter prathapkumarvemula@facebook.com http://www.slideshare.net/xavierjohn4 07775991224 Step4 : EstablishacommunicationbetweenExposedService andBPELComponentusingwire. select the transactiontype as "required"andclickon"Ok" Step5 : EstablishacommunicationbetweenBPELcomponentand External referenceusing"Wire". nowmo composite looklike bellow. Step6 : nowdouble clickonBPEL component,toadd the activities.we have toaddfollowing activities. Receive :Drag fromBPEL Activitiesanddrop in"Drop ActivityHere" Reply: Drag fromBPEL Activitiesanddropin"+" Invoke :Drag fromBPEL Activitiesanddropin"+" (we have to add3 Invokes)
vptaps@gmail.com @johnxavierv—twitter prathapkumarvemula@facebook.com http://www.slideshare.net/xavierjohn4 07775991224 Assign: Drag fromBPEL Activitiesanddropin"+" (Basedon requirementwe have toaddmultiple) Receive – isto read clientinputdata,itreadsthe data fromexposedservice.ithasonlyone variable that isinputvariable. we needtodrag and drop the receive activityinBPELflow fromBPEL Constructs -> WebService, thenwe needtodouble clickonreceive activity,itopensthe followingpopup. We have to change followingpropertiesinReceiveactivitypopup,basedonourrequirement. Name (optional) :Receive1(Default), generallywe needtocome upwithspecificname. Operation: we needtoselectthe Service operation. Create Instance : We needto selectthistostart the process.If we didnot checkit throwserror while compilingcode. Create InputVariable Reply– to sendresponse backtoclientthroughexposedservice.Ithasonlyone variable thatis outputvariable we needtodrag and drop the ReplyactivityinBPELflow fromBPEL Constructs -> Web Service,then we needtodouble clickonReplyactivity,itopensthe followingpopup. We have to change followingpropertiesinReplyactivitypopupbasedonourrequirement. Name (optional) :Reply1(Default), generallywe needtocome upwithspecificname.
vptaps@gmail.com @johnxavierv—twitter prathapkumarvemula@facebook.com http://www.slideshare.net/xavierjohn4 07775991224 Operation: we needtoselectthe Service operation. Create outputVariable. Assign– to transferthe data betweenone variable tootherendvariable.UsingAssignactivitywe can transferdata betweenanyvariable toanyvariable likeInputtoInput,InputtoOutput,Outputto Input,andOutputto Outputvariables. we needtodrag and drop the AssignactivityinBPELflow fromBPEL Constructs -> Basic Activities, thenwe needtodouble clickonAssignactivity,itopensthe followingpopup. Clickon "General tab"inPopup
vptaps@gmail.com @johnxavierv—twitter prathapkumarvemula@facebook.com http://www.slideshare.net/xavierjohn4 07775991224 Aftercompletionof above,Clickon"CopyRules"Tabto dothe mapping
vptaps@gmail.com @johnxavierv—twitter prathapkumarvemula@facebook.com http://www.slideshare.net/xavierjohn4 07775991224 if we do the mappinginAssignactivity,foreachmapping itisgenerating single copyRule.itshould looklike bellow <copy> <from>$Receive1_execute_InputVariable.part1/ns3:s1</from> <to>$Invoke1_total1_InputVariable.parameters/sub1</to> </copy> inthe copyrule we have two tags,firstone is "from"and secondone is"to". from- holdsthe data of source Variable to - Is usedtopass the "fromdata" to target variable. it isinternallyusingXPATHtoprocessthe variable data. Invoke – isusedto invoke the external service oradapter.Ithastwo Variablesone inputandoutput variable. we needtodrag and drop the Invoke activityinBPELflow fromBPEL Constructs -> Web Service,then we needtodouble clickon Invoke activity,itopensthe followingpopup. We have to change followingpropertiesinInvoke activitypopup,basedonourrequirement. Name (optional) :Invoke1(Default), generallywe needtocome upwithspecificname. Operation: we needtoselect the Service operation. Create input/outputvariables.
vptaps@gmail.com @johnxavierv—twitter prathapkumarvemula@facebook.com http://www.slideshare.net/xavierjohn4 07775991224
vptaps@gmail.com @johnxavierv—twitter prathapkumarvemula@facebook.com http://www.slideshare.net/xavierjohn4 07775991224 usinginputvariable we passinputdatato service,the responsefromservice filledinoutputvariable. likewise we have torepeatfor"Avg"and"Grade" operations. he followingare screenshots...
vptaps@gmail.com @johnxavierv—twitter prathapkumarvemula@facebook.com http://www.slideshare.net/xavierjohn4 07775991224
vptaps@gmail.com @johnxavierv—twitter prathapkumarvemula@facebook.com http://www.slideshare.net/xavierjohn4 07775991224 Nowwe needtotransformthe data betweenfollowingvariables Receive_input - invoke_total_input Invoke_total_output - invoke_avg_input Invoke_avg_output - invoke_grade_input Invoke_grade_output - Reply_output.
vptaps@gmail.com @johnxavierv—twitter prathapkumarvemula@facebook.com http://www.slideshare.net/xavierjohn4 07775991224
vptaps@gmail.com @johnxavierv—twitter prathapkumarvemula@facebook.com http://www.slideshare.net/xavierjohn4 07775991224 Note : Aftermappingwe needtoClickon"Apply"+ "Ok".

oracle soa Examples