Tuesday, February 19, 2013

How to send a message to REST service from OSB

If we want to post a message to REST service using OSB, we can do it in the following way.

Step1 : Create an generic business service.

  Select the type as Messaging Service


Choose xml as input and output message type


Select the default options in the next tabs and give the endpoint of the REST service to be invoked
 
Thats all we need to do for the business service.

Step2: Create a proxy service of xml service type


Select the defaults and complete the configuration of the proxy service.

Step 3: Create a message flow as shown below. Invoke the above created business service in the message flow as a service call out.

In the Request Action step do the following .

The first assign statement set the payload to be send to the REST service.

The critical steps are the following.

Using the TransportHeader step, set the headers to consume the rest service as shown below

In the next Insert step, overwrite the HTTP method to whatever we require. i.e: GET,POST,PUT,DELETE.MERGE etc.



Thats about the service configuration. Now test the proxy service by sending the required payload for the REST service.


Friday, February 8, 2013

Failed to resolve outbound connection pool JNDI for Adapter

There are situations the Adapter outbound connection pool configuration might not reflect at run time and often the service invocation fails due to failure to locate the JNDI.

If we verify the Adapter Configuration screen, the outboundconnection pool JNDIs will be visible.
So why does this error happen?

In such situations its worth to check whether the connection pool JNDI configuration is really updated in the weblogic-ra.xml file.

The weblogic-ra.xml file is located inside every Adapter.rar/META-INF

Most probably the entries we seen in the console will not be available in the weblogic-ra.xml.

To resolve this isssue, unzip the Adapter.rar file to a location, add the connection instance details manually to weblogic-ra.xml and repack the Adapter.rar .


Now copy this Adapter.rar to a new location under the domain.




Before installing the new RAR file, delete the existing adapter from admin console

Goto admin console ->deployments->Goto the respective adatper and delete it .






Once it is deleted , install the newly packed Adapter.rar file from the new location.








At the end select the plan.xml from the same folder itself.

Once the adapter is installed, verify the outbound connection pool configuration and ensure that all the JNDIs are visible over there
Note : If any change done to this JNDI configuration, then the adapter has to be updated to reflect the change.