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.