Tuesday, January 3, 2017

Oracle RightNow integration in SOA 11g

As many applications are rapidly moving to cloud, we might get into situations where we need to connect to cloud services. First thing, we try to find is relevant adapter. But SOA 11g does not provide many out of box cloud adapters. In fact, the only cloud adapter available in 11g is Salesforce adapter. But there is no need to worry. 11g still helps us to connect to cloud services in an easier way.

In this blog, I am going to show on how to connect to Oracle RightNow services from SOA 11g without the need of cloud adapter.

Let's start with the scenario where we are provided with the details of Oracle RightNow secured SOAP service.

Our RightNow wsdl url is as follows - http://sample--tst.custhelp.com/cgi-bin/sampletest.cfg/services/soap?wsdl
The wsdl provided to us is a polymorphic wsdl. Polymorphism is a common term used in Java, where the service can operate in different ways based on the different inputs passed. Similarly in wsdls, the polymorphic wsdls allow different payloads/different underlying structures in payload without impacting the interface consumer.  


First step is to import RightNow certificate


  • You can either check with RightNow team for the certificate or download it from browser.
  • Once you open the RightNow wsdl in the browser, click on the lock like symbol on the end of the browser.








  • It would show a screen to view certificates. Once you click on view certificates, you can see the rightnow certificate associated with the wsdl with download icon enabled. 
  • Download the certificate from the browser.

Certificate

Certificate Path
  • Import the certificate into weblogic keystore. If your weblogic server has multiple nodes, make sure that the certificate is imported to all nodes

Next step is to update OWSM policy and create security key

As RightNow service is secured SOAP service, it is essential for us to do two things
  • Attach WSS username policy to the service
  • Attach RightNow key with credentials as expected by the service

Attach OWSM Policy

Login to em console.
Under Farm -> Weblogic Domain -> Click on your weblogic domain.
Under Weblogic Domain -> Web Services -> Click on Policies as follows.


Policies

  • The policies page lists all available default policies. 
  • Here, we are interested in the OWSM policy required to configure SSL for client.  
  • Change the "Applies to" filter to "Service Clients" and "Name" to "ssl" and search.
  • oracle/wss_username_token_over_ssl_client_policy is the policy required to configure SSL to client services.
  • You can either use this default policy or create a copy of this policy with a new name and use it.
  • The Create Like button highlighted in the picture below helps to create a duplicate policy.

SSL Policy
Click on ssl client policy and select edit. By default, this client ssl policy has Include Timestamp checked. Please uncheck that. The Oracle RightNow server fails encryption link with timestamp included.

Attach RightNow key with credentials

Once you are done with policy updates, the next step is to create a key with the credentials that RightNow service is expecting.

Goto Weblogic Domain ->Security->Click on Credentials.
Security Credentials


Expand oracle.wsm.security and click on Create Key. A popup is shown as follows. 
  • Enter any name in the Key field. This field helps to refer to this key from Composite.
  • Enter User Name and Password as required by Oracle RightNow service
  • Click ok.

RightNow Key

The newly created key is shown under oracle.wsm.security as follows.

We are done with all the configurations required to integrate with Oracle RightNow service. Now, we can proceed with the composite creation and association of above configurations to the composite.

BPEL Composite integration with Oracle RightNow

  • I have created a simple synchronous BPEL Composite with name RightNowIntegration.
  • As RightNow service is exposed as SOAP, create an external reference for RightNow service through webservice adapter.
  • Connect through the RightNow reference service from BPEL. It looks as follow.

  • Now right click on the reference and Click on Configure WS Policies.
  • It will show SOA Client Policies popup. 
  • Under security, click on + icon. It will show all the Client Security Policies available on the server.
  • Select oracle/wss_username_token_over_ssl_client_policy and click ok.
  • You would see that the OWSM policy has been attached to the reference.






















  • Now click on the RightNowRef. In the property inspector, you would see all the existing properties of the reference like general properties, binding properties, etc
  • Under Binding Properties, click on the + icon and create a binding property with Name as csf-key and value as rightnow_key (This should be exactly the name given for the key created under weblogic domain). 
  • You can see the new added csf-key binding property and the OWSM policy associated as follows.
Reference

The last part is to map the input of Oracle RightNow service. As the WSDL is polymorphic, we will see on how to map the fields that are not visible during mapping.
  • Create a new transformation file with target as RightNow service wsdl's input.

  • The transformation file looks as follows. In the below target mappings, we have a complex type called RNObjects. As per the requirement of RightNow service, we need to pass various structures in RNObjects based on scenario like Organisation, Contact, Payment information etc. But the current structure within RNObjects doesnot support any such complex types.

Here comes the Polymorphic wsdl into picture. Right click on the RNObjects and click on Substitute Element or Type. 
This shows all the complex types from the schema which can be substituted for RNObjects. Here, I choose Organization.

Now, I see that the RNObjects section is updated with Organization structure. You can go ahead and map all the fields required under Organization.


Similarly, if you choose Answers as the substitution element, you can see all the fields related to Answers under RNObjects.


Once all the mappings are done, deploy the project and test. You are now good to go with Oracle RightNow Cloud Integration in SOA 11g.



No comments:

Post a Comment