Wednesday, 11 January 2017

Enable CORS in the Oracle Service bus

Enabling CORS(Cross Origin Resource Sharing) is one of the primary requirement when we are playing with multiple environments and want to access service from the different environment.

Considering, we have a OSB service that is deployed in one environment(Oracle Cloud) and want to access this service outside from the Oracle cloud environment, let's say share point environment.

To achieve this, We have to send the Access-Control-Allow-Origin header in the service response.

Drop the Transport Header Component from the component pallet in the response Pipeline with the below property:


That's it!

6 comments:

  1. Hi Ankur. According with Doc ID 2210010.1, Oracle Service Bus does not support CORS.

    ReplyDelete
    Replies
    1. yes. we spoke to Oracle and they are saying the OSB does not support CORS. How did you get it to work?

      Delete
  2. Are you able to successfully call this from any clinet?

    ReplyDelete
    Replies
    1. Yes Hari. We have consumed the OSB service in Sharepoint.

      Regards,
      Ankur

      Delete
  3. Hello ANkur,
    Thank you for the post.

    I have requirement, where I have to pass CROSS ORIGIN to call the AJAX page. I have used transport header and set "Access-Control-Allow-Origin" = '*' . While testing from POSTMAN plugin, i can see all the values passed in transport header but when we test from application, it is giving below error :



    " No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://10.3.4.15' is therefore not allowed access. The response had HTTP status code 404."



    OSB version: 12.2.1.0

    Service: REST

    Using transport header in response pipeline.

    Direction: Inbound response



    Any help/suggestion is highly appreciated.

    ReplyDelete
  4. Thanks dude it worked after soo much research !!!!

    ReplyDelete