Tuesday, 28 April 2015

Connect and consume data with Oracle RightNowCX using the new SOA12c RightNow adapter


The  Oracle RightNow adapter has been released for the SOA 12.1.3 just couple of months ago, and I tested as soon as I've heard of it!

What it is needed for this tip

  • JDeveloper 12.1.3
  • An account with read right on the WebServices exposed by an Oracle Rightnow instance

Before starting!

Make sure the following patch bundle has been applied to your SOA/jdev Home.

Bundle Patch for Bug: 20423408

The patch can be downloaded from Oracle support of course, and installed using opatch apply.
The patch must be applied to both, the SOA Server home (if not in the jdev home) and Jdev home, since the new plugin which will shows the RightNow adapter wizard, must be configured into JDeveloper.
Remember to perform the post-installation steps (patch READ-ME for details):


1. Log in to Fusion Middleware Control Enterprise Manager.
2. Expand "Weblogic Domain" in the left panel
3. Right click on the domain you want to modify and select Security > System Policies to display the page System Policies.
4. In the System Policies page, expand "Search". For "Type" select "Codebase", for "Includes" enter "jca" and click the arrow button.
5. Select "jca-binding-api.jar" in the search returned result and click "Edit".
6. In the "Edit System Grant" page, click on "Add".
7. In the "Add Permission" page, click on "Select here to enter details for a new permission" and enter the following:
  • Permission Class:oracle.security.jps.service.credstore.CredentialAccessPermission
  • Resource Name: context=SYSTEM,mapName=SOA,keyName=*
  • Permission Action: *
8. Click on "OK" to save the new permission.


In order to verify the installation went well please double check you'got the RightNow Adapter in the Cloud Adapter Component palette:



After the installation start JDeveloper with the option "jdev.exe -clean"

Hands on!

  • Generate one SOA application with an empty SOA project.
  • Drag and drop an Oracle Rightnow component in the External reference lane and the wizard will pop up
  • Insert the WSDL url (the WSDL and XSD schemas will be downloaded), also create a new csf key in Jdeveloper with your username and password for Oracle Rightnow. 


  • Select the Create WSDL operation and the Contact business object



  • Click FINISH
  • Now add a WIRE from the BPEL process to the Rightnow adapter
  • Edit the composite input XSD adding the following fields:
<element name="process">
<complexType>
<sequence>
<element name="Name" type="string"/>
<element name="LastName" type="string"/>
<element name="Address" type="string"/>
<element name="PostCode" type="string"/>
</sequence>
</complexType>
</element> 

  • Open the BPEL process and add an invoke to the adapter (create input and output variables)
  • Add a transformation which will be used to set properly the invoke input variable for the Rightnow adapter.
  • Edit the transformation as showed below. The left variable is the composite input variable, while the right one is the Rightnow input one 

  • So the BPEL process will look like this below
  • Deploy it top the integrated SOA Server
  • Last step, configure the username and password in the EM console using the CSF key MyRightNowUser configured in the JCA adapter in WeblogicDomain => Security => Credentials in the Credential Map SOA, as showed below



The SOA Composite can now be tested and hopefully an account will be created in Oracle Rightnow SC!
Let me know for any issue (see Possible problems below)!

Tip: instead of configuring the credentials in the SOA-EM, the csfkey property parameter in the jca-properties definition can be omitted and replaced with username and password parameters

Possible problems

  • In case the WebService invocation fails with this:
"Exception occurred during invocation of JCA binding: "JCA Binding execute of Reference operation 'Create' failed due to: Unable to create Cloud Operation:
The invoked JCA adapter raised a resource exception.
Please examine the above error message carefully to determine a resolution "

Then replace in the Rightnow JCA the targetWSDLURL local WSDL with the remote one, as explained here and redeploy it!


  • In case the WebService invocation fails with this:
"Exception occurred during invocation of JCA binding: "JCA Binding execute of Reference operation 'Create' failed due to: Client received SOAP Fault from server : Username is not specified in UsernameToken."

Then the credential key is not configured correctly in the credential store or the process can't see it. Review it!


  • In case the WebService invocation fails with this:
"Exception occurred during invocation of JCA binding: "JCA Binding execute of Reference operation 'Create' failed due to: Client received SOAP Fault from server : Access Denied."

Then the user-password are not correct in the credential key. Review it!


Please find the RightNow Cloud Service Adapter documentation here!
The source code of the composite created here

No comments:

Post a Comment