Upload
naveen
View
218
Download
0
Embed Size (px)
Citation preview
7/25/2019 2.Develop a Synchronous Service for Division of Two Numbers (1)
1/26
The Start up scripts for starting admin server and soa server will be available in
Middleware home\ user_projects\domains\murali_domain\bin
In my case : C:\racle\Middleware\user_projects\domains\murali_domain\bin
!evelop a synchronous application which will accepts two numbers as input"
performs division of two numbers and returns the output#
$# Start the weblogic server%&dmin server'
If you want to start the weblogic server later run the command from the command prompt:
7/25/2019 2.Develop a Synchronous Service for Division of Two Numbers (1)
2/26
on successsful start of the admin server the following message will be displayed at the comand prompt:
7/25/2019 2.Develop a Synchronous Service for Division of Two Numbers (1)
3/26
&ow open the browser and give the following url:
http:44localhost:50014console
user name: weblogic
password: welcome12
now under muralidomain4environment4servers
we can see the admin server up and running:
http://localhost:7001/consolehttp://localhost:7001/console7/25/2019 2.Develop a Synchronous Service for Division of Two Numbers (1)
4/26
2. Starting Soa server
7or this go to :89racle#oaMiddleware8userproects8domains8muralidomain8bin
And run startManagedWebLogic.bat soa_server1 http://murali:71 or
And run startManagedWebLogic.bat soa_server1
9n successful start the follwing message will be displayed:
&ote : soa server will ta;e + mins
http://murali:7001/http://murali:7001/7/25/2019 2.Develop a Synchronous Service for Division of Two Numbers (1)
5/26
&ow if we refresh in the admin console the status of the soaserver will be changed to running as shown below:
3 . Now open the Jdeveloper
The Jdeveoper view will be as shown:
Create a new project under the same application where you have created
synch&!!
7/25/2019 2.Develop a Synchronous Service for Division of Two Numbers (1)
6/26
Clic( on )e*t+
)ow here we need to select the type of composite we want to develop,e are going to develop composite which will have one bpel process# So select
composite with BPE process and clic( on -nish#
7/25/2019 2.Develop a Synchronous Service for Division of Two Numbers (1)
7/26
nce you clic( on -nish our application and project will be created and prompted
for creation of our bpel component as shown below:
7/25/2019 2.Develop a Synchronous Service for Division of Two Numbers (1)
8/26
.or the /pel process provide the details re0uired:)ame: give some meaningful name say for e*#" Synch!iv1rocessor)amespace: either you can leave the default value provided for this or change
what ever you want:http:22*mlns#friend3corps#com2Morning/atch1racticse_jws2Synch!iv2Synch!iv1roce
ssor4nder template drop down select !"nchronous bpel process#now clic( on o(#
This has completed creating our basic components.or any bple project there will be one default *sd will be created and will be
available under #sdfolder name# in our case the -le name is
!"nch$ivProcessor.#sd. !ouble clic( on this -le and modify the *sd to hold two
simple elements for input and one simple element for output as shown
http://xmlns.friendzcorps.com/MorningBatchPracticse_jws/SynchDiv/SynchDivProcessorhttp://xmlns.friendzcorps.com/MorningBatchPracticse_jws/SynchDiv/SynchDivProcessorhttp://xmlns.friendzcorps.com/MorningBatchPracticse_jws/SynchDiv/SynchDivProcessorhttp://xmlns.friendzcorps.com/MorningBatchPracticse_jws/SynchDiv/SynchDivProcessor7/25/2019 2.Develop a Synchronous Service for Division of Two Numbers (1)
9/26
)ow double clic( on Synch!ivprocessor#bpel -le# It5s contents will be displayed
under editing area#
The bpel will be used for implementing business functionality# 6ere the
functionality is nothing but get the re0uest%consisting of two numbers'" perform
the addition of those two numbers and return the result#)ow we have to build an arithmetic e*pression %div_result 7 number$ div
number8'#.or this drag and drop the assign activit"from component palette as shown
below:
7/25/2019 2.Develop a Synchronous Service for Division of Two Numbers (1)
10/26
)ow double clic( on the assign activity# )ow the assign activity will be opened#9o to general tab and give proper name for activity say
&ssign_divisionresultTdiv_resultSelect copy operation available under cop" operationtab#
)ow the create copy operation window will be displayed as shown below:
7/25/2019 2.Develop a Synchronous Service for Division of Two Numbers (1)
11/26
The left hand side variables are the ones based on which we want to build our
e*pression%number% divnumber&'ight hand side variable are the ones to whom we want to assign the result# In our
case we have to assign to div_result available under out put variable :
)ow we have to buld the e*pression number% divnumber&..or this purpose select e*pression under type in from
7/25/2019 2.Develop a Synchronous Service for Division of Two Numbers (1)
12/26
)ow clic( on the e*pression bulder as shown below:
7/25/2019 2.Develop a Synchronous Service for Division of Two Numbers (1)
13/26
)ow the e*pression builder will opened as shown below:
7/25/2019 2.Develop a Synchronous Service for Division of Two Numbers (1)
14/26
)ow e*pand input variable till number$ and number 8 as shown below:
7/25/2019 2.Develop a Synchronous Service for Division of Two Numbers (1)
15/26
)ow select number $ and clic( on insert in to e#pression. this will inser the
number$ in to the e*pression area as shown below
7/25/2019 2.Develop a Synchronous Service for Division of Two Numbers (1)
16/26
)ow we have to place the divoperator# .or this go to mathematical functions as
shown below
7/25/2019 2.Develop a Synchronous Service for Division of Two Numbers (1)
17/26
)ow clic( on o()ow you can see e*pression in from area as shown below:
7/25/2019 2.Develop a Synchronous Service for Division of Two Numbers (1)
18/26
)ow the e*pression will loo(s li(e below:
7/25/2019 2.Develop a Synchronous Service for Division of Two Numbers (1)
19/26
)ow insert the number8 as you did for number$ and clic( on (#)ow the result has to be assigned to div_result available under output variable#
.or this e*pand the output variable till div'result and select thediv'result.
7/25/2019 2.Develop a Synchronous Service for Division of Two Numbers (1)
20/26
)ow clic( on o(# This will completes our copy operation and will return to assign
window as shown below:
)ow clic( on apply and clic( on o(#This has -nished developing our service#)ow clic( on saveall#
7/25/2019 2.Develop a Synchronous Service for Division of Two Numbers (1)
21/26
)ow compile" !eploy and test the application as you did for synch&dd#
Scenarios: number$7; and number8 7< then div_result78 number$7= and number8 7 < then div_result7= number$7> and number8 7 = then div'result()n*nit".
So we should not do division when the number8 7=#So we should chec( the value of number8 if it is e0ual to =%3ero' then we shouldn5t
do div# show some error message saying ?number8 value can not be 3ero@.+ther wise do the div and show the div'result to end user.!o to per,orm this checking we have activit" called switchactivit".)ow drag a switch activity before the assign activity as shown below:
Switch activity will be having two branches$# Case branch A which we can use to test some condition# If the condition is true
then case branch will be e*ecuted# Case branch is mandatory and we can have
any number of case branches#8# ther wise A this branch will be e*ecuted when the condition speci-ed in case
branch is false#This is optional and we can have at ma* one otherwise bloc(#
7/25/2019 2.Develop a Synchronous Service for Division of Two Numbers (1)
22/26
)ow clic( on the condition and provide the following values:Babel: number8 e0uals to 3ero!escription: if number8 e0uals to 3ero then we should not perform division
operation#
)ow we have to build the e*pression %if number87='# So for this clic( on the
launch e*pression builder as shown below:
7/25/2019 2.Develop a Synchronous Service for Division of Two Numbers (1)
23/26
)ow build the e*pression on number 8 element as shown below
)ow clic( on o(#
7/25/2019 2.Develop a Synchronous Service for Division of Two Numbers (1)
24/26
)ow our case condition is done# Clic( on o(#)ow drag the assign activity%&ssign_divisionresultTdiv_result' under
otherwise bloc(#
)ow it loo(s li(e below:
7/25/2019 2.Develop a Synchronous Service for Division of Two Numbers (1)
25/26
)ow we are done with if number is not e0uals to 3ero#)ow we have to ta(e assign activity in to case branch and assign the te*t
message ?number & can not be -eroto output div_result#
)ow clic( on o(# Save all# our -nal process should li(e below:
7/25/2019 2.Develop a Synchronous Service for Division of Two Numbers (1)
26/26
)ow save the service#Compile" deploy%8#=' and test it from em console#