Friday Sep 27, 2013

REST Enabling Oracle Fusion Sales Cloud using Java

Oracle Fusion Sales Could (Rel7) currently has a WebServices/SOAP interface however many clients & partners are interested in accessing Oracle Fusion Sales Cloud using REST & JSON. The main difference between a SOAP service and a REST service is the “way” you get access to the data and methods you use. Whilst SOAP is very powerful, very complete and also can be quite complex perhaps over-complex. REST in comparison is rather simple and uses the http verbs (GET,POST,PUT etc) to define the operation and can be as powerful as you desire.

There are many documents on the web which discuss REST vs SOAP but in summary :              


Originally defined as Simple Object Access Protocol.

A protocol specification for exchanging structured information in the implementation of Web Services in computer networks.

An envelope, which defines what is in the message and how to process it
A set of encoding rules for expressing instances of application-defined datatypes
And a convention for representing procedure calls and responses.

Relies on eXtensible Markup Language (XML) as its message format, and usually relies on other Application Layer protocols (most notably Remote Procedure Call (RPC) and HTTP) for message negotiation and transmission.

This XML based protocol consists of three parts:


RESTful web service (also called a RESTful web API) is a simple web service implemented using HTTP and the principles of REST. Such a web service can be thought about as a collection of resources. The definition of such a web service can be thought of as comprising three aspects:

The base URI for the web service, such as

The MIME type of the data supported by the web service. This is often JSON, XML or YAML but can be any other valid MIME type.

The set of operations supported by the web service using HTTP methods (e.g., POST, GET, PUT or DELETE).




Why would you want to use REST instead of SOAP?

There are many reasons why one would/could want to use REST instead of SOAP, one reasons is that SOAP is considered too heavy-weight for mobile applications, where payload size is critical, and also instead of XML, JSON is the preferred  message format.

The JSON message format is also very appropriate when interfacing with systems that use JavaScript (such as browsers or node.js) and hence adds weight to the desire to use REST instead of SOAP for accessing Oracle Fusion Sales Cloud.

So getting to the matter at hand and getting RESTful

So enough of why REST , how does one do it for Oracle Sales Cloud (aka CRM). Thankfully this is rather straightforward, at Oracle OpenWorld 2013 you would have seen Thomas Kurian demonstrate our new Oracle SOA Suite and how it can transform a SOAP service into a REST service whilst this is excellent and incredibly productive some clients dont want to install SOA Suite soley for this purpose. Thankfully its possible to do the same using pure Java and deploy it to a cloud infrastructure, like the newly release Oracle Java Cloud Service. It is however worth noting that using SOA Suite is preferable because it accelerates the deployment tremendously and would ultimately be more "agile". 

So what are the basic steps to REST enable a Fusion Sales Cloud Service?  

  1. Download and install the Jersey REST libraries, we'll use these for the creation of the RESTful service
  2. Generate the SOAP Client Side Proxie(s) for Oracle Sales Cloud. In this example we're using static proxies however for a more industrialized approach Id recommend going down the dynamic proxy route, more flexible and less likely to break at runtime, however at a development cost.
  3. Create "wrapper" JAXB Objects so that you can return XML data. This is needed because the baseline SOAP clients dont have @RootElement  (s) defined.
  4. Create the RESTful project and expose the services you require.
  5. Deploy to your runtime Java contain, like the Oracle Java Cloud Service
  6. Consume by your favourite client, like a mobile phone etc 

For the purpose of the tutorial (in the document), I've documented step by step how you can build the above, query Oracle Fusion Sales Cloud, manage security  (for development & production) and how to deploy the code to the Oracle Java Cloud. Obviously take note that this document is more of a tutorial than anything else when building your own custom REST Adaptor you would tailor it specifically to what services your client (mobile phone, javascript widget etc) requires.

Happy reading



This document and source code is sample code and assumes no support from Oracle Corporation or myself. 

Wednesday Sep 25, 2013

Sample Payload : Batch insert/update

Question came up in a call today, is it possible to do batch webservice updates using the Oracle Sales Cloud webservice interface??

The answer is YES, but not all webservices support this. The operation is called "process<ObjectName>",and you need to check in the ADFService list of operations, in FusionOER , that the service supports the process<xxx> syntax.

For example LocationService and  OpportunityService support the process operation but the SalesPartyService does not.

Also you will find there are typically two operations, process<object> and processCS<object> the difference being that the first one you supply it with a list of objects and one operation (ie update all locations), whereas in processCS you can provide a unique operation for each and every object.

From FusionOER for the opportunity service

Operation Description  Parameters  Return value
processOpportunity Performs a Create, Update, Delete, or Merge operation on a list of Opportunity rows. The specified operation is applied to all objects in the given list. String changeOperation ,
java.util.List Opportunities,
processControl oracle.jbo.common.service.types.ProcessControl

 A list of opportunities that are successfully processed
processCSOpportunity  Performs a Create, Update, or Delete operation on a list of Opportunity rows. Different operations may be applied to different objects, depending on what is specified in the ChangeSummary object.

oracle.jbo.common.service.types.ProcesssData processData,
processControl oracle.jbo.common.service.types.ProcessControl

 A list of opportunities that are successfully processed

And a sample payload looks like

<soapenv:Envelope xmlns:soapenv="" xmlns:typ="" xmlns:loc="" xmlns:par="" xmlns:sour="" xmlns:loc1="" xmlns:typ1="">
            <loc:Address1>510 Quercia Marcozzi</loc:Address1>
            <loc:Address2>Building 300</loc:Address2>
            <loc:Address1>510 Quazi Marcozzi 2</loc:Address1>
            <loc:Address2>Building 500</loc:Address2>

Monday Aug 12, 2013

Some Fusion CRM payloads for creating SalesAccounts

Some payloads for creating customers in FusionCRM, namely

  • Create a location in Fusion CRM
  • Add the location to the Sales_Prospect making it into a SalesAccount
  • Add a sales person to the SalesAccount
  • Make the salesPerson the primary account owner

1.       Create a new  Location, using createLocation in the  LocationService

<soapenv:Envelope xmlns:soapenv="" xmlns:typ="" xmlns:loc="" xmlns:par="" xmlns:sour="" xmlns:loc1="">






            <loc:Address1>510 Quercia Marcozzi</loc:Address1>

            <loc:Address2>Building 300</loc:Address2>









2. Add the location to the Sales_Prospect making it into a SalesAccount using SalesPartyService

<soapenv:Envelope xmlns:soapenv=""















       <soapenv:Header />




                           <!-- PartyID of the organization -->



                                  <!-- PartyID of the organization -->



                                         <!-- PartyID of the organization -->


                                         <!-- PartyID of the location you wish to add -->


                                         <!-- Module which created the entry, ZCM is the code for the UI, can

                                                be others -->












3.       Add the Resource(SalesPerson) to the SalesAccount, using createSalesAccountResource, in the SalesPartyService

<soapenv:Envelope xmlns:soapenv="" xmlns:typ="" xmlns:sal="">





<!—The code indicating how the resource is assigned to the sales account team. The possible values are contained in the ZCA_ASSIGNMENT_TYPE lookup.à


            <sal:ResourceId>300000000623680</sal:ResourceId>             <sal:SalesAccountId>300000000690006</sal:SalesAccountId> </typ:salesAccountResource>


4.       Make the new person the Account Lead, using updateSalesParty, in SalesPartyService

<soapenv:Envelope xmlns:soapenv="" xmlns:typ="" xmlns:sal="" xmlns:org="" xmlns:par="" xmlns:con="" xmlns:sour="" xmlns:con1="" xmlns:org1="" xmlns:par1="" xmlns:rel="" xmlns:org2="" xmlns:rel1="" xmlns:per="" xmlns:per1="">

5.    <soapenv:Header/>

6.    <soapenv:Body>

7.       <typ:updateSalesParty>

8.          <typ:salesParty>

9.             <sal:PartyId>100000000055273</sal:PartyId>

10.             <sal:SalesAccountId>300000000629280</sal:SalesAccountId>

11.          </typ:salesParty>

12.       </typ:updateSalesParty>

13.    </soapenv:Body>

14.               </soapenv:Envelope>

Tuesday Jun 11, 2013

Exporting Items

Following on from the previous article, an easy way of exporting the InventoryItemIds is to use the Embedded BI Publisher in Fusion Applications

Login as a Fusion Systems Administrator, and select Reports and Analytics

Create a Report 

Create a new data model

Give the Data Model a name and store it in a folder 

 Now select the data set and create a "SQL Query" 

Enter the SQL query. For items there are two tables we need to be concerned with egp_system_items_b  (the base table) and egp_system_items_tl (contains the translated descriptions). We need to query both tables even if we dont have any translations as the base language description is stored in the translations table.

Select the datasource to be "ApplicationDB CRM", although this might change for your installation/version

 After saving this dialog and hitting the screens save button on the far right hand side

 Then select the XML icon, this allows us to run the query AND export the data as XML

The result!

and yes you can export it to a file 

Monday Jun 10, 2013

FusionCRM :Adding a Product Item and a Product Group to a CRM Opportunity

Recently it was asked to me how one can insert a product item/group into a Fusion CRM Opportunity. First thing is one needs to understand the difference between a CRM Product Item and a CRM Product Group. 

A Product Item is a Item, usually managed externally from Fusion CRM, often from Fusion PIM or uploaded independantly.

A  Product Group is a collection of Product Items collected together in the "Manage Product Group" screen within Fusion Setup and Maintenance.

When inserting into an opportunity a product group, or a product item, you will need to know the product group ID (ProdGroupId) or the InventoryItemIds+InventoryOrgId respectively.

You can get a list of all your product group IDs, by exporting the object "ProductGroupDetailExpPVO" in the "Schedule Export Processes" task within "Setup and Maintenance" 

The payload for inserting a product Item within an Opportunity is

and for inserting a ProductGroup is similar but for product groups you dont need the InventoryOrgId.

Finally if you want to do this as part of a groovy script,e.g trigger from a button, the script would look something like this

Thursday Jun 06, 2013

ADF Mobile Local Database and Offline support

Hey all,

Frederic from our product mgmt team has produced a nice short (32min) webcast on the Local database (SQLite) in ADF Mobile and  specifically he discusses how to use it to implement offline support in your ADF Mobile applications.

 Nice webinar...

Check it out here

Friday Apr 05, 2013

Debugging ADF Mobile apps, quick tip

Don't you miss the Weblogic console when developing Oracle ADF Mobile applications?? I do..  Well there is a neat workaround for Android.

Oracle ADF Mobile outputs quite a bit of debug information onto the Android logcat, which is quite useful.

To see the Android logcat, you can execute the following command (Windows or Linux)

adb logcat

and logcat will continue logging everthing which happens on your android phone to your operating systems command line..

However a better approach is to use Eclipse logcat.

 If you install eclipse and install the Android Development Toolkit  (link) you get the same functionality as the command line logcat, but with the additional features

I've since discovered that the Android SDK actually has a program called "Monitor" which appears to be an Eclipse based UI dedicated for debugging your device.. It has information on the heap, threads,network statistics and lots more! but importantly for us the logcat functionality is identical to whats available in eclipse (same plugin I guess)

  • Pretty colours, makes it easier to see Information vs Debug messages
  • A quick & easy UI for setting up filters , so you can configure it to filter only for messages from your application  


Tuesday Oct 30, 2012

Oracle Launches Mobile User Experiences Design Patterns

Mobile design requires a different way of thinking. Use Oracle’s mobile design patterns to design iPhone, Android, or browser-based smartphone applications.  We are sharing our mobile design patterns and their baked-in, scientifically proven usability to enable Oracle customers and partners to build mobile apps quickly.

Our design patterns are common solutions that developers can easily apply across all application suite products. Crafted by our insight into Oracle Fusion Middleware, the patterns are designed to work with the mobile technology provided by the Oracle Application Development Framework

Tuesday Sep 25, 2012

Oracle ADF Essentials - An free version of Oracle ADF

Not sure if you’ve seen this announcement, but Oracle have launched a free version of Oracle ADF, named ADF Essentials..

Its basically a  version of Oracle ADF which can also run on other app Servers and contains the full ADF Stack from ADF Faces , ADF Controller/Model and ADF Business Components.

See here for more information

also see an independent review at

Wednesday Aug 22, 2012

Beautiful websites with Oracle ADF/Webcenter

I've been following a thread on the ADF Enterprise Methodology group on google with some interest recently, which has prompted this blog posting..

Its all about "Can Oracle ADF-Faces be used to create a truly uber-sexy website", complete with sizzle ??

The answer is yes of course! Oracle ADF-Faces can produce a sexy website.

It's true that Oracle ADF-Faces was originally designed to be quick RAD framework for building Oracle Fusion Applications and it succeeds there, and over time its rapidly being used for building UIs for all of Oracle's products, from internal applications, task screens for Oracle BPM worklists, Enterprise Manager screens and is the main framework you would use with Oracle Webcenter Portal (& Spaces). The latter particularly leans towards a user audience which craves ubersexyness and sizzle vs an expenses clerk who is only really interested in getting the job done efficiently, although nice looking would be nice...

So your building an Oracle ADF website and you want it to look good where should you start?? Well Oracle ADF Skinning is the first port of call. Even with simple skinning you can create some really nice looking interfaces, just look at, an Australian Health Website and, specifically uses pure ADF, for both of these sites checkout the look and feel of the registration page to get an idea of what can be done..

Want some sizzle? 

So far although the websites could look good, they're clean, efficient and nice looking and depending on your view they might lack uber-sexyness let alone sizzle.. For that you'll probably need some custom javascript and CSS3.  Oracle ADF supports a client side javascript API which allows you to add  your own javascript and thus you can create and invoke client side javascript to hide and show canvases etc.. A good example of this being used on the web, although not built with Oracle ADF, is the O2 website, when you move your mouse over the lower panels (Phones & Tariffs,Priority Moments etc) it hide/shows a panel below. This can easily be done in Oracle ADF with some simple client side javascript which hide/shows Oracle ADF Panels, I'll create an example in a later post showing how to do this.

So far so good, but what about uber-sizzle?

Well anythings possible with a good dose of javascript, CSS and a good graphics designer, however for the most of us doing this javascript uber-sizzle is a little beyond us (well it is me! :-), this is where 3rd party libraries come to the rescue.  According to theregister , the "current" defacto standard javascript library is the JQuery library, it provides a number of components (some of which compete with ADF components),makes javascript easier to use,  but more importantly it includes a number of "animations" which can be added to a website, these animations by themselves can make a website look ooooerrrr... and thats precisely what a number of web designers do..

A number of my ADF clients have used JQuery in their websites and one of the most common usage of the animate method is to have images slide across or panels slide in-out of view. Examples of this components include this blog and Nivo.

Oracle ADF websites which use JQuery/JavaScript

All of these use JQuery in someway, most of them for animations, such as a ticker at the top in Ferrovial, Image slider in and LADWP. 

Also checkout a blog entry by a friend of mine, Duncan Mills, here, he shows whats possible with CSS3 Animations and ADF. I particularly like the ability to have the Next/Previous button hidden in a panel on the left hand side, something which is very popular in the Mac/Ubuntu Desktops at the moment...

So there you have it, you can use a Rapid Development Framework like Oracle ADF-Faces, use the native components and then add libraries like JQuery and give it some sizzle.

In a later blog posting I'll explain how one integrates JQuery with ADF to add some sizzle. 

However, before I leave you here are some important notes :

  • I/Oracle does not endorse the usage of 3rd Party libaries like JQuery, they should work but some might not play nice
  • If possible always try to use the native components in Oracle ADF first, then apply skinning/CSS and finally use a framework like JQuery if needed.
  • Remember beauty is in the eye of the beholder, get people to review the work :-)
  • Read the thread on the ADF Enterprise Development group it has some really good comments

Wednesday Aug 08, 2012

Getting rid of the JSESSIONID from the URL for ADF/Webcenter

Today's short snippet 

Yesterday I had a call from a partner of mine who is implementing a system and they asked the curious question.. 

"Can we get rid of the JSESSIONID parameter from the URL line of a Webcenter application"..

My first thoughts were why?, its part of the session management of any J2EE application but it turns out that the security conscious client wants to make session high-jacking of a Webcenter application much harder and doesnt like the jsessionid on the url line..

Make sense,

Thankfully this is quite easy, Weblogic server has a parameter in the weblogic.xml file  which allows you the ability to control how sessions are managed and one of these is to force that the JSESSIONID token is force-ably implemented via cookies and not URL parameters. This obviously has the disadvantage that if the browser doesnt have cookies enabled then your application wont work...

Cookies however can also be intercepted/viewed too, so I also recommended that they rename the session cookie so that automated tools looking for JSESSIONID wont find it..

The weblogic.xml now looks like


You can also set this from JDeveloper by editing your projects weblogic.xml file and using the "overview" mode of the wizard.


Obviously the best next thing is to ensure all communication is also SSL encrypted.

Monday Aug 06, 2012

Monitoring memory in JDeveloper11g

Just found this blog posting by Andrejus on turning on an internal feature to monitor memory consumption used by JDeveloper 11g.. Why is this interesting? Well, the default appears to be 800Mb for heap, depending on your usage you might want to increase this and these settings allow you to "see" if the changes are making a difference..

Obviously I want to stress that these flags are undocumented and I would also keep a copy of the configuration files before editing them.. just in case..

Friday Jun 22, 2012

UI Design Patterns : Are you developing a Fusion Apps extension, an ADF or Webcenter App?

A big question I get asked when speaking to partners who are developing Oracle ADF, or Webcenter, Apps is how to make it look nice.. Some of the big System Integrators ask me, "Do we have any design patterns/guidelines we can use?". .. Alas website design is a very personal thing and each website will have different requirements and needs, however I am now pleased to say we've just launched "Oracle Fusion Applications Design Patterns" website. 

 The website is the result of many years of Oracle R&D into user interface design for Fusion applications and features a really cool web app which allows you to visualise the UI components in action.

Although many of the design patterns are related to ADF , its worth noting that ADF took its lead from Oracle Fusion Applications User Interface needs - not the other way around, its just taken us a while to publish these. Coupled together with the dashboard patterns this makes are really cool extra asset for your kit bag


Wednesday Jun 20, 2012

Fusion Map

Found this on the web, cool roadmap, or should I say tubemap, to your path to understanding Fusion Apps cute..



Tuesday May 15, 2012

Active Active Webcenter Portal Install


As some of you know previously active-active installations of Oracle Webcenter portal isnt supported out of the box till now!. There are many reasons, some of which are database related and some of them are simply due to the amount of moving parts there are.. However fear not a fantastic white paper has just been released explaining all the steps and how to get it all working in a supported fashion

Read the document and enjoy your new Highly Available Infrastrucutre

See here 


Architect & Technology Evangelist - If its middleware,PaaS/SaaS integration then I'm interested

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.


« April 2015