Upload
amit-sharma
View
225
Download
0
Embed Size (px)
Citation preview
7/27/2019 Oracle SoA Hands-on Project
1/51
Getting Started with Oracle SoA
Working with Custom Faults Lab#9
Description:BISP is committed to provide BEST learning material to the
beginners and advance learners. In the same series, we have
prepared a complete end-to end Hands-on Beginners Guide for Oracle
SoA. The document focuses on various Custom fault handling
techniques in BPEL process.Join our professional training program and
learn from experts.
History:Version Description Change Author Publish Date0.1 Initial Draft Shiva Kant Pandey 21st Sep 20120.1 Review#1 Amit Sharma 29th Sep 2012
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 1
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
2/51
Custom faults: Are those faults which is defined by developer for certain limitations.
SUMMARY:
Custom fault enables to display custom messages when given criteria fail to meet. Example
input marks of individual subject should not be smaller than zero and greater than hundred.
This kind of restrictions can be imposed by developer so if wrong marks are input then it shows
custom fault message.
Step wise procedure of project on topper student project with fault handling (customfault):
Step 1: Open ProcessStudent Project & under it open ProcessStudentProcess.bpel as shownbelow
Step 2: In design mode Drag & Drop Switch Activity so that bpel can set condition
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 2
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
3/51
Step 3: Click on condition part to set if condition for switch activity
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 3
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
4/51
MOTIVE OF SWITCH ACTIVITY :
Our motive is setting condition that if marks are smaller than zero or greater than hundredthen throw custom/business fault & also reply this fault as output else choose otherwisecondition if input marks are correct & keep all components inside this otherwise condition
Step 4: Click on Expression builder shown below :
Step 5: Click on lang1 marks ---> insert into expression ---> Logical Function ----> smaller --->insert into expression ---> 0 (zero) or Click on lang1 marks ---> insert into expression --->
Logical Function ----> greater ---> insert into expression ---> 100 (hundred) or Click on lang2marks ---> insert into expression ---> Logical Function ----> smaller ---> insert into expression---> 0 (zero) or Click on lang2 marks ---> insert into expression ---> Logical Function ---->greater ---> insert into expression ---> 100 (hundred) or Click on lang3marks ---> insert intoexpression ---> Logical Function ----> smaller ---> insert into expression ---> 0 (zero) or Click onlang3 marks ---> insert into expression ---> Logical Function ----> greater ---> insert intoexpression ---> 100 (hundred)as shown below
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 4
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
5/51
Step 6: Click on Ok .
Step 7 : Drag & drop Assign Activity & Rename It as AssignCustomFault :
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 5
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
6/51
Step 8: Drag & drop Throw Activity"This activity throws the fault data to the catch activity"
Step 9: Rename throw activity asThrowInvalidMarksFault
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 6
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
7/51
Step 10: Double Click On Throw activity & Edit Throw activity , Click On Browse icon shownbelow
Step 11:Observe that there is no fault message under Project WSDL Files in
ProcessStudentProcess.wsdl so first create fault message inside ProcessStudent wsdl file for
custom fault .
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 7
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
8/51
Step 12: Observe ProcessStudentProcess.wsdl in design mode that inside port type it has only
two process one is Input & other output but not containing Fault as its third process so create it
in source mode .
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 8
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
9/51
Step 13:Now edit this wsdl in source mode
Step 14: edit PortType as shown below :
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 9
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
10/51
Step 15: Edit Message Type Definition as shown below :
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 10
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
11/51
Step16: Import Error.xsd from oramds , open resource palette ---> SOA-MDS
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 11
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
12/51
-->dev mds con ---> apps--->Error.xsd
to get schema location of error.xsd click once on it & use ctrl +shift+c then paste inside
schemalocation , delete all before apps & write oramds:/ before apps . then copy namespace
from error.xsd & paste here inside namespace .
Step 17: Register namespace of Error.xsd with prefix "err" .
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 12
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
13/51
Step 18: As completed editing wsdl click on design mode & observe fault process
Explore fault on clicking [+] sign & see that it contains InvalidStudentMarks faultMessage
associated with its part .
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 13
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
14/51
Step 19: Click on Imports & check imported xsd
Step 20: click on Schema mode to see included xsd .
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 14
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
15/51
Step 21: Open ProcessStudentProcess.bpel & Throw activity again
Step 22: Now observe that this time wsdl contains Invalid studentMarksfaultMessage click on
it & hit ok .
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 15
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
16/51
Step 23: Create Variable as shown below & click OK
Step 24: Check detail & hit OK .
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 16
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
17/51
Step 25: Check variables by clicking on icon .
Step 26: Check that all QName is associated with its prefix , so observe here that
InvalidStudentMarksFaultVar does not contains its prefix so click on QName & edit variable , it
should be message type , click on Browse
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 17
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
18/51
Step 27: Click on that InvalidStudentMarksFaultMessage & click OK
Step 28: Again Check variables by clicking on icon .
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 18
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
19/51
Step 29: Click on assign custom fault & start assigning fault data
Step 30: To assign faultCode t click on expression Drag & Drop on faultCode as shown below
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 19
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
20/51
Step31: Write Expression i.e fault code as 'FMW-002'
Step 32: Similarly severity as 1
Step 33: Select Date Functions & under it select current-date-Time then insert into Expressionthen click ok
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 20
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
21/51
Step 34: Similarly Detail as 'INVALID MARKS SELLECTION'
Step 35: For CompositeName click Advanced functions ----> getCompositenName theninsert into Expression
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 21
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
22/51
Step 36: For ComponentName click Advanced functions ----> getComponentName theninsert into Expression
Step 37: For CompositeInstanceId click Advanced functions ----> getCompositeInstanceId theninsert into Expression
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 22
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
23/51
Step 38: Observe all assigned values
Step 39: Drag & drop Reply Activity & click twice on it to edit reply as shown below:
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 23
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
24/51
Step 40: Edit Reply as shown below :
Step 41: Click on compile icon to compile the bpel process
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 24
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
25/51
Step 42: Build successful
Step 43: Deploy project by clicking ProcessStudent to devsoa
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 25
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
26/51
Note: Before Deployment Start Weblogic Admin Server as discussed in my previous documentOracle Soa Part IV Doc.
Step 44: Click on Browser icon shown below:
Step 45: Start your enterprise manager by writing url http: //localhost:7001/em/
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 26
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
27/51
Note : Here localhost is application server & 7001 is a port in which enterprise manager isrunning.
Step 46 : Login using credentialsUser Name :weblogic
Password : welcome1click on login
Step 47: We have successfully login inside Enterprise manager 11g (Farm_dev_soa)
we can clearly observe here that admin server is up & all deployment status is also up it meansthat our admin server is running .
Now In left pane of window under Farm_dev_soa click on SOA radio button now again expand& under default we can easily see all the deployed projects.Click on Processstudent twice
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 27
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
28/51
Step 48: Click on TEST & create instance
Step 49:Explore payload & select tree view
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 28
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
29/51
Step 50: Fill all blank spaces as shown below
Step 51: Click on Test Web Service
And get Response shown below:
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 29
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
30/51
Step 52: Now since input lang1 marks is 150 & so it displays custom error or
InvalidStudentMarks Error as shown below .
Click on close .
Step 53 : Parse wsdl & again try with these inputs shown below :
Click on Test Web Service
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 30
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
31/51
Step54 : Observe response without error because this time all input lang marks are between
0 & 100.
Step 55: All instances are completed & instance 320002 is completed with custom fault &
instance 320003 is completed without errors .
NOTE: Now how we catch these faults through invoking service , next steps are concentrated
on this question in which calling service is TopperStudent Service .
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 31
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
32/51
Step 56: Open Topper Student Process . bpel click on Add catch all activity shown below
NOTE: Catch activity can catch only system faults where as catch all activity catches businessfault .
Step 57: Click on source mode .
Copy all activies of catch & paste inside catch all block in sorce mode
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 32
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
33/51
Step 58: Copy catch as shown below
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 33
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
34/51
Step 59: Paste inside Catch all activity
Step 60: Change into design mode & save by clicking save icon
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 34
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
35/51
Step 61: Drag & drop Scope Activity as shown below:
Scope Activity : This activity consists of a collection of activities that can have their own local
variables , fault handlers, compensation handlers and so on . A scope activity is analogous to a
block { } in programming language .Each scope has a primary activity can be complex
structured activity that, with many nested activities within it to arbitrary depth. The scope is
shared by all the nested activities .
Step 62: Now drag & drop all components inside scope activity as shown below :
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 35
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
36/51
NOTE: Since we have made changes in ProcessStudentProcess.wsdl in ProcessStudentProject
hence also need changes in imported ProcessStudentProcess.wsdl in TopperStudent Project so
that catch activity catch this custom fault as remote fault in TopperStudentProject .
Step 63: Open ProcessStudentProcess.wsdl in TopperStudentProject by clicking on it &
observe in design mode that it does not have fault process .
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 36
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
37/51
Aim : Our aim is to copy the required content from 'M wsdl ' to 'N wsdl'
Where M= 'ProcessStudentProcess.wsdl' in ProcessStudent Project
& N= ' 'ProcessStudentProcess.wsdl' in TopperStudentProject
Step 64: Copy imported Error.xsd from M.wsdl as shown below:
Step 65: Paste imported Error.xsd to N.wsdl as shown below:
Step 66:Copy registered namespace from M.wsdl as shown below:
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 37
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
38/51
Step 67: Paste registered namespace from N.wsdl as shown below:
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 38
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
39/51
Step 68: Copy MessageType from M.wsdl as shown below:
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 39
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
40/51
Step 69: Paste MessageType to N.wsdl as shown below:
Step 70:Copy PortType from M.wsdl as shown below:
Step 71: Paste PortType to N.wsdl & save all by clicking save icon
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 40
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
41/51
Step 72: Click N.wsdl in design mode & observe that now created Fault as process .
Step 73: Add Terminate activity to terminate catch process as shown below
& save all .
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 41
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
42/51
Step 74: Click on compile icon to compile the bpel process
Step 75: Compilation successful with o errors & o warnings .
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 42
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
43/51
Step 76 : Deploy project by clicking TopperStudentProject.
Deployment Finished
Note: Before Deployment Start Weblogic Admin Server as discussed in my previous documentOracle Soa Part IV Doc.Step 77 : Click on Browser icon shown below:
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 43
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
44/51
Step 78: Start your enterprise manager by writing url http: //localhost:7001/em/
Note : Here localhost is application server & 7001 is a port in which enterprise manager isrunning.
Step 79 : Login using credentialsUser Name :weblogicPassword : welcome1click on login
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 44
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
45/51
Step 80: We have successfully login inside Enterprise manager 11g (Farm_dev_soa)we can clearly observe here that admin server is up & all deployment status is also up it meansthat our admin server is running .Now In left pane of window under Farm_dev_soa click on SOA radio button now again expand& under default we can easily see all the deployed projects.Click twice on TopperStudentProject .
Step 81: Click on TEST & Create instance
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 45
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
46/51
Step 82: Input Student array size =2
Step 83: Scroll down page & Provide required input of a students
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 46
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
47/51
Step 84: Click on Test Web Service
And get Response shown below:
Step 85: Now we can see that catch activity catch the fault & replied to the client asFaultdata Response but here catch activity cached it as remote fault thats why fault code isFMW-0001 & detail of custom fault is displayed inside Detail as FMW-002 , Invalidmarks as shown below :
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 47
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
48/51
Step 86: Check flow trace
Fig (1)
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 48
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
49/51
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 49
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
50/51
Fig (2) Fig (3)
Fig (4)
Step 87: Observe instances & instance state is terminated because of terminate activity now
finally click on shutdown tab
Step 88: Shut down confirmation ,Click yes
www.bispsolutions.com www.bisptrainigs.com www.hyperionguru.com Page 50
http://www.bispsolutions.com/http://www.bisptrainigs.com/http://www.bispsolutions.com/http://www.bisptrainigs.com/7/27/2019 Oracle SoA Hands-on Project
51/51
Step 89: Successfully shut down the composite