You are on page 1of 10

SOA Suite Resources

Product Documentation
Main Oracle Fusion Middleware 11.1.1.6 Documentation Page SOA/BPM Doc Page SOA(SCA) Developer's Guide Tech Adapters Guide Oracle Service Bus Developer's Guide

Useful Links
SOA Suite Main Page on OTN Oracle Service Bus Main Page on OTN SCA Main Page on OTN Advanced SOA Suite on OTN Recommended Books

Blogs
SOA Thinker (Emphasis on OSB) Redstack (Advanced SOA for Oracle Architecture Team) Java Oracle/SOA Blog (Great Blog from dude in Netherlands)

Code Samples
Official Oracle SOA Suite Samples

Education
Oracle University InClass and Live Virtual Training Oracle Learning Library (Videos, Tutorials,Oracle By Example)

Deployed Scripts and Usage


We set up two Linux services using chkconfig to automatically start on boot and stop on shutdown. This was done by placing the nodemgr and oracle-orcl scripts in /etc/init.d as the root user. On startup the oracle-orcl service calls /home/oracle/bin/db.sh to start the database and listener. The nodemgr service starts and allows us to start weblogic admin and managed servers

Convenience Scripts
Located under /home/oracle/bin these can be used to start and stop components. Should be logging in as oracle user.

db.sh Used to start and stop Oracle DB and Oracle DB Listener. Note: This is managed automatically by the init scripts. You can manually run these as oracle to start/stop. You could also log in as root and issue $ service oracle-orcl stop $ service oracle-orcl start $ db.sh start orcl $ db.sh stop orcl nodemgr Node Manager is a java process which runs on the host which can manage start and stop of WebLogic AdminServer and Managed Servers. Note: This is managed automatically by the init scripts. You can log in as root and issue $ service nodemgr start $ service nodemgr stop start-wls-server.sh This script will take a list of server names to start. Typically after a reboot use this script to start AdminServer. Once AdminServer is running, you can use the WebLogic console to start and stop managed servers. You can also call this script directly to start the managed servers required (if admin server is not started it will automatically start it) Examples: $ start-wls-server.sh admin (Starts AdminServer) $ start-wls-server.sh all (Starts admin,osb_server1,soa_server1,bam_server1) $ start-wls-server.sh osb (Starts AdminServer,osb_server1) $ start-wls-server.sh sca (Starts AdminServer,soa_server1) $ start-wls-server.sh soa (Starts AdminServer,osb_server1,soa_server1) $ start-wls-server.sh bam (Starts AdminServer,bam_server1) Shutdown (recommended before re-booting the server) <oracle> $ stop-wls-server.sh all Typical start up after re-boot <oracle> $ start-wls-server.sh soa

JSON-LIB Code
I primarily followed the example available in the Official Oracle Sample Code Site OSB JSONREST. Some of my notes below: NOTE: Theres also an interesting take on this at http://biemond.blogspot.com/2009/05/osb-restservice-with-xml-json-output.html. He uses some more advanced code to format the JSON. Library Downloads NOTE: I didnt need to download some of the libraries as theyre already included in Weblogic installation. Library json-lib-2.4-jdk15.jar Download Sourceforge Description Main JSON Lib

ezmorph-1.0.6.jar commons-lang-2.6.jar xom-1.2.8.jar

Sourceforge Apache Group XOM Cafe Con Leche

Ezmorph Commons Lang 2.6 XML Object Model

Deploying Libraries to WebLogic You have some options here. You could deploy the dependent libraries packaged in the main class jar. You could create a weblogic shared library. The simplest method is to drop the above jars into <DOMAIN_HOME>/lib and restart Weblogic

Create JDeveloper Application for JSONXMLConverter Class.


1. Create a new JDeveloper Application of type Generic. Give it a a package prefix of osb.tools.json

2. Create Project, give it a name and click Finish.

3. Right-click the project and select Project Properties from the Context Menu.

4. Select Libraries and Classpath and click on Add Library..

5. Select Libraries Commons Logging 1.0.4, Commons Collections 3.1, Commons Beanutils 1.6 and click Okay.

6. Add the 4 jars listed above. These can be anywhere. In my case I created a lib directory under JSONTools/JSONProject and put them there.

7. Click the Add Jar/Directory and include the four files into the classpath.

8. Create a new Java Class. Right-click on JSONProject and select New. Then select Java Class.

9. Name it JSONXMLConverter and click Okay.

10. Copy in Sample Code below. JSONXMLConverter Sample Code


import net.sf.json.JSON; import net.sf.json.JSONObject; import net.sf.json.xml.XMLSerializer; public class JSONXMLConverter { public static String json2xml(String strJSON,String rootElementName, String namespace) { JSON json = net.sf.json.JSONSerializer.toJSON(strJSON); XMLSerializer xmlSer = new XMLSerializer(); xmlSer.setRootName(rootElementName); xmlSer.setNamespace("", namespace); xmlSer.setTypeHintsEnabled(false); xmlSer.setTrimSpaces(true); String xml = xmlSer.write(json); return xml; } public static String xml2json(String strXML) { XMLSerializer xmlSer = new XMLSerializer(); xmlSer.setTypeHintsEnabled(false); xmlSer.clearNamespaces(); JSONObject json = (JSONObject) xmlSer.read( strXML ); return json.toString(); } }

11. Right-click on the .java File and Select Make to ensure no compiler warnings.

Successful compilation: 0 errors, 0 warnings. 12. Right-Click on JSONProject and select Project Properties

13. Select Deployment and New

14. Select Archive Type Jar and give it a name, in my case jsontools

15. Accept defaults and click OK twice

16. Right-click JSONProject and select Deploy|jsontools. Accept default of Deploy to Jar File and click Finish.

17. Your Jar file will be available under JSONTools/JSONProject/deploy. This can be uploaded to Oracle Service Bus Console.

PlatLog Integration
NOTE: This was a quick setup. I would do more planning around the proper JDBC Driver to use (MS vs. Weblogic) and enabling XA Transactions. The only thing different is I used sqljdbc4.jar from Microsoft Configuring SOA Suite with MS SQL Server

You might also like