You are on page 1of 37

Develop a synchronous application which will accepts two numbers as input, performs addition of

two numbers and returns the output.


1. Start the weblogic server(Admin server)
If you want to start the weblogic server later run the command from the command prompt:

on successsful start of the admin server the following message will be displayed at the comand prompt:

<Mar 26, 2011 12:59:05 AM IST> <Notice> <WebLogicServer> <BEA-000365> <Server st


ate changed to RUNNING>
<Mar 26, 2011 12:59:05 AM IST> <Notice> <WebLogicServer> <BEA-000360> <Server st
arted in RUNNING mode>
<Mar 26, 2011 1:00:44 AM IST> <Error> <org.apache.beehive.netui.pageflow.interna
l.AdapterManager> <BEA-000000> <ServletContainerAdapter manager not initialized
correctly.>

Now open the browser and give the following url:


http://localhost:7001/console
user name: weblogic
password: welcome123
now under murali_domain/environment/servers
we can see the admin server up and running:

2.

Starting Soa server

For this go to C:\OracleSoaMiddleware\user_projects\domains\murali_domain\bin


And run startManagedWebLogic.bat soa_server1 http://murali:7001 or
And run startManagedWebLogic.bat soa_server1

On successful start the follwing message will be displayed:


Note : soa server will take 3-5 mins.

Now if we refresh in the admin console the status of the soa_server will be changed to running as shown below:

3 . Now open the Jdeveloper


The Jdeveoper view will be as shown:

Application server instance creation:


Go to jdeveloper and go to the application server view as below:

Now select application server and say new server as shown below:

Now you will be prompted for type of server you want to create:

Select standalone server and click on Next>


You will be prompted for app server connection name as shown below:

Provide name of your choice. In my case it is murali_appserver and click on Next>


You will be prompted for weblogic server password:

Provide the password that you have used during installation:


In my case it is welcome123.
Now click on Next>
You will be prompted for domain name and port details:

Provide the details as shown above and click on Next>


Now you can test the app server connection by clicking on test buttion.
If everything is fine then you will get success message as shown below:

Now click on Finish.


This completes the appserver connection creation.

3. Creating New Application:


An application is a higher level component which can have multiple projects.
New application can be created by file/new:
Now select SOA application available under the current project
technologies/general/Applications

Now click on Ok
Now provide the application name as shown below:

Now click on next>


Now provide the project name as shown below:

Click on Next>
Now here we need to select the type of composite we want to develop
We are going to develop composite which will have one bpel process. So select
composite with BPEL process and click on finish.

Once you click on finish our application and project will be created and prompted for
creation of our bpel component as shown below:

For the Bpel process provide the details required:


Name: give some meaningful name say for ex., SynchAddProcessor
Namespace: either you can leave the default value provided for this or change what
ever you want:
http://xmlns.friendzcorps.com/MorningBatchPracticse_jws/SynchAdd/SynchAddProcess
or
Under template drop down select Synchronous bpel process.
now click on ok.
This has completed creating our basic components
For any bple project there will be one default xsd will be created and will be available
under xsd folder name. in our case the file name is SynchronousAddProcessor.xsd.
double click on this folder, you can see its contents editing area.

By default two complex elements will be created . each of these two will be having one
simple type elements. For our case we need two elements(int type) for input and one
element for output(int type). So we will be editing the complex elements and create the
required. After editing our final xsd will be having the below structure. Click on save all
as shown below

Now double click on SynchAddprocessor.bpel file. Its contents will be displayed under
editing area.

The bpel will be used for implementing business functionality. Here the functionality is
nothing but get the request(consisting of two numbers), perform the addition of those
two numbers and return the result.
Now we have to build an arithmetic expression (sum = number1+number2).
For this drag and drop the assign activity from component palette as shown below:

Now double click on the assign activity. Now the assign activity will be opened. Select
copy operation available under copy operation tab.
E

Now the create copy operation window will be displayed as shown below:

The left hand side variables are the ones based on which we want to build our
expression(number1+number2)
Right hand side variable are the ones to whom we want to assign the result. In our case
we have to assign to sum available under out put variable :

Now we have to buld the expression number1+number2.


For this purpose select expression under type in from

Now click on the expression bulder as shown below:

Now the expression builder will opened as shown below:

Now expand input variable till number1 and number 2 as shown below:

Now select number 1 and click on insert in to expression. this will inser the number1 in
to the expression area as shown below

Now place the operator + at the end of the expression and insert the number2 as we
did for number1.
The final expression will looks like blelow:

Now click on ok
Now you can see expression in from area as shown below:

Now the result has to be assigned to sum available under output variable. For this
expand the output variable till sum and select the sum.

Now click on ok. This will completes our copy operation and will return to assign
window as shown below:

Now click on apply and click on ok.


This has finished developing our service.

Now click on saveall.


Next we need to build(compile) our prject. For this purpose right click on the SynchAdd
project and click on make SynchAdd.jpr

If everything is fine we will b e getting 0 errors and 0 warnings under bpel


log/Messages.

Next we need to deploy our application to soa server. For this right click on SynchADD
and say deploy as shown below:

Now follow the below screen shots to get it deployed:

Click on next>

Click on Next>
Select the application server connection(murali_appserver) and click on next

Now select our soa_server(by default selected) and click on next>

Now click on next>

Click on finish>
This will start the deployment process
If everything went well we can see our component got deployed successfully under
deployment log.

Now we need to test our composite. For this go to em console


http://murali:7001/em/
provide the user name and password that you have given during installation .
user id: weblgoic
password: welcome123
After logging in expand the farm_murali_domain/soa/soa_infra/default
This is the place where all of our deployed composites will be available.

Just click on our synchAdd this will load the default test environment on right side as
shown below: here click on test

Now come down and provide the input as shown below and click on test webservice:

Now you can see the result(sum)

Now if you want to test the web service again repeat the process.

You might also like