We are going to learn how to create our first “Hello World” process in Oracle SOA 11g today. It presumes Oracle SOA 11g is installed and started. Also, JDeveloper should have composite editor plugin installed.
Open JDeveloper 11g (18.104.22.168.0). If not already downloaded, you can get it from http://www.oracle.com/technology/software/products/jdev/htdocs/soft11.html Create a new Generic Application and name it SOATrainingSamples.
Click Next. In the next screen, specify New Project Name as HelloWorld. From available technologies, select SOA. This will import SOA relevant libraries into our project.
From next screen, select Composite with BPEL option. There are other composite options available, which we’ll explore in other samples.
Click Finish. This will prompt a “Create BPEL Process” screen. Name BPEL process as HelloWorldProcess. Select “Synchronous BPEL Service” template. Click OK.
JDeveloper creates HelloWorldProcess BPEL components and displays corresponding BPEL process.
From list of activities on the right hand navigation pane, lets drag “Assign” activity and drop between “receiveInput” and “replyOutput” activities.
Double click on “Assign_1″ activity and open it. Select “Copy Operation” from this screen.
Copy following expression into Expression Field.
concat('Hello ', bpws:getVariableData('inputVariable','payload','/client:process/client:input'))
Update 14-Jan-2012: If you are using SOA Suite 22.214.171.124.0 or above, please use
concat('Hello ', string(bpws:getVariableData('inputVariable','payload','/client:process/client:input')))
. This is because XML element is not converted to string value by default and requires explicit conversion.
This can also be created from XPath Expression Builder. Assign this expression to “outputVariable” as shown above and click OK.
Compile BPEL process by clicking on “Make HelloWorld.jpr” link as shown below:
Ensure BPEL process is successfully compiled. To deploy to Weblogic server, right click on “HelloWorld” from left side navigation and select Deploy -> HelloWorld. Following images show sequence of steps to deploy BPEL executable.
Connection to SOA Server needs to be created beforehand. In this example, a connection named SOAServerConnection was already created.
A successful deployment message is displayed at the bottom of JDeveloper window.
Next, let us check the deployed process through Weblogic’s EM console. Open http://localhost:7001/em. Drill down to “default” domain from SOA node on the left side navigation bar.
Select “HelloWorld [1.0]” process and click on “Test” service.
Input payload can also be seen in XML format by selecting “XML View”.
Response will have “Hello” prefixed to our input string “World”.
This completes our Hello World process.