TIBCO ActiveMatrix BusinessWorks Plug-in for REST and JSON HTTP PUT operation in plug-in dispatch does not work when a request is sent from Chrome or FireFox.

TIBCO ActiveMatrix BusinessWorks Plug-in for REST and JSON HTTP PUT operation in plug-in dispatch does not work when a request is sent from Chrome or FireFox.

book

Article ID: KB0088754

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks Plug-in for REST and JSON -
Not Applicable -

Description

Description:

When a cross origin resource sharing (CORS) request for a PUT operation is sent to a REST service built with the plug-in dispatch activity, there is a problem when the request is sent from a browser such as Chrome or FireFox because of the different behavior of those browsers in sending the request. The same request works fine when sent from IE.
Symptoms:
When the request is sent from Chrome or FireFox, that request is not handled properly. A similar error is reported in the client.

XMLHttpRequest cannot load http://txserarchapp01.sddev.lpl.com:7901/alerts/?alertId=2&alertNotes=2/10/…06:21:55PM%20-%20john.employee%20bala%20test%20ytty%20test&alertStatusId=4. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:63013' is therefore not allowed access. default.html:1

Cause:
The browser sends an OPTIONS operation before it sends a PUT operation. If the OPTIONS operation is not handled correctly in the REST service, the above error is reported in the client and the following PUT request cannot go through.

Issue/Introduction

TIBCO ActiveMatrix BusinessWorks Plug-in for REST and JSON HTTP PUT operation in plug-in dispatch does not work when a request is sent from Chrome or FireFox.

Resolution

Add the function in the project to handle the OPTIONS operation. This can be done by adding an additional workflow in the BusinessWorks process to receive and reply the request with the OPTIONS operation method. Also, HTTP connection resource should be in the type of HTTP Component to allow HTTP receiver to get the OPTIONS request.

Additional Information

About cross origin resource sharing:  http://en.wikipedia.org/wiki/Cross-origin_resource_sharing