Sunday 14 October 2018

SOA 12c : Shell Script to set Environment variables

This is what you you should do if you want to use a shell script to set your environment variable.

1. Create a .sh file ex: setEnv.sh
2. Edit and add like below:

#!/bin/sh

#*****************************************************************************
# This script is used to set up your environment for development with WebLogic
# Server.  It sets the following variables:
#
# JAVA_HOME    - Location of the version of Java
# ANT_HOME     - Location of the version of ANT
#*****************************************************************************

JAVA_HOME="/jdk/jdk1.8.0_131"
ANT_HOME="/oracle_common/modules/org.apache.ant_1.9.2"

export JAVA_HOME ANT_HOME
echo "Your environment has been set."


3. Edit paths based on you machine/environment.
4. Save
5. Execute the script using the command . ./setEnv.sh

6. Validate by executing the command echo $JAVA_HOME

You can add other variables as required.


Helpful? Please comment.

Happy Learning!!

SOA 12c RESTAdapter : Creating a REST Binding


In Oracle SOA Suite 12c we have the much awaited REST adapter, which allows easily integrate REST into your services for XML, JSON or URL-encoded payload.

This is what you should do if you want to expose your service using a REST binding.

We will create a REST POST web-service which  will receive either XML, JSON or URL-encoded parameters and pass them to the BPEL.

Steps:

1. Create new SOA Application and Project
2. Create/Import your schema/XSD file
 If you want to create a schema from scratch, on the 'New Gallery' choose the 'XML Schema'

3. Next we drag a REST Adapter from the Components Palette into the Exposed Services column at the composite.xml, this will bring up the 'Create REST Binding' wizard



Next

4.  At the 'Operation Bindings' section, click on the 'green plus sign' and then click on  'Add operation binding', this will bring up the 'REST Operation Binding' wizard:



5. Provide an Operation Name, define your HTTP verb as POST



6. At the 'Request' tab you will see the options offered for payload: XML, JSON, URL-Encoded and No Payload. Select all except 'No Payload'

7. At the Schema URL field available, we will click on that one’s search icon and select the  'Input' element on the XSD.


8. Click on the 'Generate Sample Payload' button to create sample input payloads.

9. Repeat steps 6 and 7 for 'Response' tab.

10. Click OK to create the operation and OK again on the 'Create REST binding' wizard.

11. Create a Synchronous BPEL process, drag a BPEL component to the composite.xml screen.

12. On the creation wizard, at the Input/Output section, select our XSD element for both and uncheck 'Expose as a SOAP Service'

13. Your  composite should look like below



14. Connect your BPEL and Adapter.
15. In your BPEL add Assign activity and map Input to Output variables.
16. Save all.
17. Deploy and Test.


Helpful? Please comment.

Happy Learning!!



OSB 12c : Dynamic Routing to Business/Proxy Service

Dynamic routing is a kind of  Content-based Routing pattern, which is used when the BusinessService/ProxyService path is required to be de...