Вы находитесь на странице: 1из 9

IT2401 - Service Oriented Architecture

EX.NO: 9 CREATION OF A BPEL MODULE AND A COMPOSITE


APPLICATION
Aim:
Create a SOA project with BPE !odu"e to co#po$e a we% $ervice&
Procedure:
STEPS TO CREATE A BPEL MODULE
Creating a new BPEL Module Proe!t
The following sections use the Synchronous sample project, and provide step-by-step directions for
creating a simple BPEL module project, using the Synchronous sample project
To Create a BPEL Module Proe!t
! "n the #etBeans "$E, choose %ile & #ew Project
The #ew Projects wi'ard appears
( )nder *ategories, select Service +riented ,rchitecture
'& )nder Projects, select BPEL -odule and clic. #e/t
0 "n the #ame and Location page, enter the project name 1for this e/ample 2ello3orld4 and
specify the project location or accept the defaults
1
Prepared B(: &)o$ephine *$ha St&+avier,$ Catho"ic Co""e-e o. En--/
Chun0an0adai&
IT2401 - Service Oriented Architecture
5 *lic. %inish
The Projects window now contains a project node for the BPEL -odule project
Creating a BPEL Pro!e"" U"ing t#e BPEL De"igner
#ow that you have created your 6-L Schema and 3S$L $ocument, you can create your BPEL
process
To Create t#e BPEL Pro!e""
! "n the Projects window, e/pand your BPEL module project node, right-clic. the Process
%iles node, and choose #ew -& BPEL Process
The #ew BPEL Process dialog bo/ appears
2
Prepared B(: &)o$ephine *$ha St&+avier,$ Catho"ic Co""e-e o. En--/
Chun0an0adai&
IT2401 - Service Oriented Architecture
( Enter a name for the process file name 12ello3orldProcess for this e/ample4, and clic.
%inish
The new BPEL file opens in the $esign view of the BPEL $esigner
"f the Palette and Properties windows are not displayed in your current view, clic. 3indows -&
7eset 3indows on the #etBeans menu
8 ,dd a partner lin. to the BPEL Process
a "n the Projects window, e/pand your project9s Process %iles node and select the wsdl
file 1Synchronouswsdl for this e/ample4
b $rag the 3S$L file from the Projects window to the left side of the $esign view
canvas
The "$E provides visual prompts to show you where you can drop the selection
The BPEL Editor adds a partner lin. to the canvas
0 ,dd a 7eceive activity to the BPEL Process
a %rom the 3eb Service section of the Palette window, select the 7eceive activity
'
Prepared B(: &)o$ephine *$ha St&+avier,$ Catho"ic Co""e-e o. En--/
Chun0an0adai&
IT2401 - Service Oriented Architecture
b $rag the 7eceive activity to the 2ello3orldProcess process bo/ in the $esign view
canvas, between the Process Start and the Process End activities
The 7eceive! activity is added to the process bo/
c *lic. the 7eceive! activity9s Edit icon
The 7eceive! Property Editor appears
d +n the -ain tab, change the value in the #ame field to "tart
e %rom the Partner Lin. drop-down list, choose PartnerLin$%
The "$E populates the +peration field with #ew3S$L+peration
f *lic. the *reate button ne/t to the "nput :ariable %ield
The #ew "nput :ariable dialog bo/ appears
g *lic. +; to accept the default values
h *lic. +; to close the 7eceive! Property Editor
The $esign view displays the new connection between PartnerLin.! and the Start activity in the
process bo/
5 ,dd a 7eply activity to the BPEL Process
a Select the 7eply activity in the 3eb Service section of the Palette $rag and drop the
7eply to the prompt between the Start activity and the Process End activity in the
process bo/ on the design view canvas
, 7eply! activity is added to the design view canvas
b *lic. the 7eply! activity9s Edit icon
The 7eply! Property Editor appears
c +n the -ain tab, change the value in the #ame field to End
d %rom the Partner Lin. drop-down list, choose PartnerLin.!
The "$E populates the +peration field with #ew3S$L+peration
4
Prepared B(: &)o$ephine *$ha St&+avier,$ Catho"ic Co""e-e o. En--/
Chun0an0adai&
IT2401 - Service Oriented Architecture
e To create a new output variable, ma.e sure that #ormal 7esponse is selected, and
clic. the *reate button ne/t to the "nput :ariable %ield
The #ew "nput :ariable dialog bo/ appears *lic. +; to accept the default values
f *lic. +; to close the 7eply! Property Editor
The $esign view displays the new connection between the End activity in the process bo/ and
PartnerLin.!
< ,dd a ,ssign activity to the BPEL Process
a Select the ,ssign activity in the Basic ,ctivities section of the Palette $rag and drop
the ,ssign to the prompt between the Start activity and the End activity in the
process bo/ on the design view canvas
The ,ssign! activity is added to the design view canvas
b Select the ,ssign! activity and clic. the -apper button on the editors toolbar
The BPEL -apper appears
c -ap the param, node under :ariables -& #ew3S$L+peration"n -& inputType in
the +utput pane of the BPEL -apper, to the param, node under :ariables -&
#ew3S$L+peration+ut -& resultType in the "nput pane of the -apper To do this,
select the param, node under :ariables -& #ew3S$L+peration"n -& inputType in
the +utput pane, and drag your cursor to the param, node under :ariables -&
#ew3S$L+peration+ut -& resultType in the "nput pane
This assignment copies the input statement into the output
1
Prepared B(: &)o$ephine *$ha St&+avier,$ Catho"ic Co""e-e o. En--/
Chun0an0adai&
IT2401 - Service Oriented Architecture
= To save your changes clic. the Save ,ll icon in the "$E menu bar
Creating a Co&'o"ite A''li!ation Proe!t
, BPEL -odule project is not directly deployable >ou must first add a BPEL -odule project, as a
?B" module, to a *omposite ,pplication project >ou can then deploy the *omposite ,pplication
project $eploying the project ma.es the service assembly available to the application server and
enables its service units to run
To Create a New Co&'o"ite A''li!ation Proe!t
! *hoose %ile & #ew Project 1*trl-Shift-#4
( "n the *ategories list choose Service +riented ,rchitecture, in the Projects list choose
*omposite ,pplication, and clic. #e/t
8 "n the #ame and Location page, change the project name to 2ello3orld,pplication, and
specify the location of project files
0 To set the new *omposite ,pplication the main project as main, leave the Set as -ain
Project chec.bo/ selected, and clic. %inish
5 To add the BPEL -odule as a ?B" module to the *omposite ,pplication project, right-clic.
the new *omposite ,pplication and choose ,dd ?B" -odule
The Select Project dialog bo/ opens
< Select the 2ello3orld project you created earlier and clic. ,dd Project ?,7 %iles
The Select Project dialog bo/ closes and the 2ello3orldjar file is added to the ?B" -odules node
of the 2ello3orld,pplication *omposite ,pplication
Building and De'lo(ing t#e Co&'o"ite A''li!ation Proe!t
Building a project compiles the BPEL source file and pac.ages the BPEL file and web service
artifacts, including 3S$L and 6S$ files, into a ?,7 archive $eploying the project compiles the
2
Prepared B(: &)o$ephine *$ha St&+avier,$ Catho"ic Co""e-e o. En--/
Chun0an0adai&
IT2401 - Service Oriented Architecture
files in the *omposite ,pplication project, pac.ages the compiled BPEL and related web service
artifacts 1including 3S$L and 6S$ files4 into an archive, and deploys them to the ,pplication
Server
To Build and De'lo( t#e Co&'o"ite A''li!ation Proe!t
! 7ight-clic. the *omposite ,pplication project9s node, and choose Build
3hen the build is complete the +utput window reports Build Successful "f the +utput window is
not visible, choose 3indow -& +utput -& +utput
( 7ight-clic. the *omposite ,pplication project9s node, and choose $eploy
8 $eployment has succeeded when you see a Build successful message in the @lass%ish tab of
the +utput window
0 +pen the Services window and e/pand Servers -& @lass%ish :( -& ?B" -& Service
,ssemblies to see your new deployed Service ,ssembly
"f you do not see the deployed project, right-clic. the Service ,ssemblies node and choose 7efresh
Te"ting t#e Co&'o"ite A''li!ation
>ou can test your *omposite ,pplication project by adding test cases, binding to the operation,
supplying input, and then using the tester
Te"t t#e )ello*orldA''li!ation Co&'o"ite A''li!ation Proe!t
! "n the Projects window, e/pand the 2ello3orld,pplication project node, right-clic. the Test
node, and choose #ew Test *ase
The #ew Test *ase wi'ard opens
( ,ccept the default test case name, Test*ase!, and clic. #e/t
8 %rom the Select the 3S$L $ocument page, e/pand the 2ello3orld - Proecss %iles node,
select Synchronouswsdl, and clic. #e/t
3
Prepared B(: &)o$ephine *$ha St&+avier,$ Catho"ic Co""e-e o. En--/
Chun0an0adai&
IT2401 - Service Oriented Architecture
0 %rom the Select the +peration to Test page, select the +peration! and clic. %inish
, new Test*ase! node is added under the project9s Test node in the Projects window, containing
two subnodes, "nput and +utput
The Source Editor appears containing the "nput file, "nput/ml
Note +
"f the Source Editor does not contain a tab for "nput/ml, double-clic. the "nput node in the Projects
window to open the file
5 %rom the "nput/ml tab of the Source Editor, do the followingA
a Locate the lineA
BsynAparam,&CstringCBsynAparam,&
b 7eplace CstringC with 2ello 3orld, so that the line appears as followsA
BsynAparam,&2ello 3orldBsynAparam,&
c %rom the #etBeans "$E menu bar, clic. Save ,ll
< "n the Projects window, double-clic. the +utput node under Test -& Test*ase!
+utput/ml is opened in the Source Editor "nitially, +utput/ml is empty until the first test run
populates the file
= "n the Projects window, right-clic. the Test*ase! node and choose 7un from the pop-up
menu
3hen the +verwrite Empty +utput dialog bo/ appears, clic. >es to accept new output The first test
run populates the +utput/ml file displayed in the Source Editor
4
Prepared B(: &)o$ephine *$ha St&+avier,$ Catho"ic Co""e-e o. En--/
Chun0an0adai&
IT2401 - Service Oriented Architecture
The test compares the output to the contents of the output file Because the first run of the test has
nothing to compare itself to, the first test fails SubseDuent test runs will compare their output with
the contents of +utput/ml and should succeed
E 7un the test again
The test case is compared to the current output file and succeeds
Re"ultA
Thus a S+, project with BPEL module to compose a web service was created successfully
5
Prepared B(: &)o$ephine *$ha St&+avier,$ Catho"ic Co""e-e o. En--/
Chun0an0adai&

Вам также может понравиться