Saturday, December 7, 2013

Call REST Web service from OSB

Call REST Web service from OSB

Define Business Service:

a. In Business Service General Tab select Service Type as Messaging Service.
b. In Messaging Tab select Request Message Type as None and Response Message Type as Text Requirement>
c. In Transport Tab, select protocol as http and at Endpoint URI section give      REST service URI.
d. In HTTP Transport Tab, select GET for HTTP Request Method

Define Prosy Service:
a. Create Proxy Service with following details
b. At Message Tab: select Message Type as Messaging Service 
c. At Messaging Tab: select Request Message Type as xml and Response            Message Type as XML
d. At Message Flow Tab: add Routing Action and Rout to earlier created               usiness service. 

e. Add three Insert actions at Routing Request Action as shown in image. 

In first insert activity, set following property.
Expression: GET
Location: as first child of
Xpath : ./ctx:transport/ctx:request

In Variable: Outbound


Select second Insert action and set the below property,
Expression:
Location: as first child of
XPath: ./ctx:transport/ctx:request
In Variable: outbound 

Set below value in third insert action:
Expression: ,
Note: give value to http:query-parameters, use ‘,’ to give multiple query-parameters
Location: as first child of
XPath: ./ctx:transport/ctx:request/http:query-parameters
In Variable: outbound 

Test the proxy.

1 comment:

  1. Hi Chandra,

    Can you please let me know how to onboard REST GET method service on osb

    Regards,
    Amarnath.Ch

    ReplyDelete