Oracle SOA Hello World Example

Let's create a new BPEL process for showing a simple HelloWorld message.
Using Jdeveloper 12c and its integrated weblogic.
First we will create a new SOA application and new SOA project.

Oracle SOA Hello World Example Process steps:


File -> New -> Application


Select SOA Application

Enter application name and click Next
Enter project name and click Next
Select Empty Composite and click on Finish

We have created SOA application and SOA project as of now.

XSD file creation:

First lets create XSD file with request and response.
Right click on schemas folder -> New -> From Gallery



From New Gallery window, select XML Schema.


Enter XML schema name and click OK

Create elements like below in the xsd fle.
This xsd source look like this below.

<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.example.org"
            targetNamespace="http://www.example.org" elementFormDefault="qualified">
  <xsd:element name="HelloWorldRequest">
    <xsd:annotation>
      <xsd:documentation>A sample element</xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="firstname" type="xsd:string"/>
        <xsd:element name="lastname" type="xsd:string"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="HelloWorldResponse">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="fullname" type="xsd:string"/>
        <xsd:element name="message" type="xsd:string"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>

BPEL process creation:

Right click on composite.xml design view and select BPEL process.

1)- Enter BPEL process name 
2)- Select Template as "Synchronous BPEL Process"
3)- Click on search button
4)- Select recently created XSD request and response types.



BPEL process looks like below in composite.xml after creation.

Now right click on BPEL process and click on Edit.



After BPEL process file is opened, 
1.Drag Assign component from components palette.
2.drop between receiveInput and receiveOutput.




Double click on Assign component and from right hand side drag functions button and drop on fullname element.
And use string concat() function to concat firstname & lastname.



 Again drag functions button from right hand side and drop on message element.
And enter message as "Hello World".

The Assignment from input and output looks like below.

Click Apply and click on OK.
Save all your changes.


Deploy the project:

Before you deploy the project make sure weblogic server  is up and running.
Now right click on the project and click on deploy by selecting the project.

Click on Next in Deployment Action dialog.


select check box "Overwrite any existing composites with the same revision ID." and click on Next in "Deploy configuration" dialog.

click on Next in Select Server dialog.


click on Next in SOA Servers dialog.


click on Finish in Summary dialog.

Verify is SOA build success in SOA tab.

Verify is deployment success in Deployment tab.


Test our BPEL process:

Login into url -> http://localhost:7101/em   with your weblogic login credentials. (You have given credentials while creating a domain)

Next at left hand side, expand SOA and click on soa-infra
Next Select Deployed Composites tab and select our SOAHelloWorldProject.

Next click on Test button.

Now on Request tab, enter request details in the input fields and click on Test Web Service button located at bottom.

Now you can observe the Hello World message on Response tab.
full name --> firstname and lastname are appended.
message --> Hello World.




No comments:

Post a Comment