Topic
  • 3 replies
  • Latest Post - ‏2012-01-17T17:26:17Z by r_olivieri
r_olivieri
r_olivieri
61 Posts

Pinned topic Enabling JSONP on BPM 7.5.1

‏2011-12-21T22:33:37Z |
Environment: BPM 7.5.1 (Windows)

We are trying to figure out how to enable JSONP on a BPM 7.5.1 Process Center. The InfoCenter documentation states the following:

Because of security considerations, support of JSONP is not enabled by default. To enable JSONP support, set the associated property in the 100Custom.xml file for the process server:
<jsonp-enabled>true</jsonp-enabled>

We found this file on our system:
C:\IBM\BPM\v7.5\profiles\ProcCtr01\config\cells\IBM-D6QJANPP25LNode01Cell\nodes\IBM-D6QJANPP25LNode01\servers\server1\process-center\config\100Custom.xml

After opening this file, we saw that the content inside the <properties> tags was commented out. We then added the following inside the <properties> tags:


<properties> <server> <jsonp-enabled>true</jsonp-enabled> </server> </properties>


That did not seem to make a difference. We also tried adding the JSONP element as a child of the <properties> tag:


</properties> <jsonp-enabled>true</jsonp-enabled> </properties>


For both scenarios, we tried accessing the following URL:

http://localhost:9081/rest/bpm/wle/v1/exposed/process?accept=application/x-javascript&callback=tst

The response from the Process Center was the same in both cases: a JSON object that contains an array of the exposed processes. It did not return the JSON object wrapped in a JavaScript function call. As a reference, this is what the product documentation states about JSONP calls:

JSONP responses (BPD-related REST APIs only)
To request that response data is to be returned in the JSONP format, you must specify a application/x-javascript response media type using either the Accept HTTP header or the accept URI parameter. You must also specify the JavaScript function name using the callback URI parameter. The response consists of the JSON content wrapped in a JavaScript callback function invocation. For example:

GET /rest/bpm/wle/v1/task/...?accept=application/x-javascript&callback=mycallback
Does someone know how to enable JSONP? Are we doing something wrong? Thanks.
Updated on 2012-01-17T17:26:17Z at 2012-01-17T17:26:17Z by r_olivieri
  • padamstx
    padamstx
    51 Posts

    Re: Enabling JSONP on BPM 7.5.1

    ‏2012-01-08T04:53:23Z  
    The general instructions for updating your 100Custom.xml file are located in the InfoCenter, here.

    The 99Local.xml file contains the default value of various configuration parameters. You'll find the "jsonp-enabled" element within the "common" element in this file. So, to enable JSONP support, you would need to add something like this in 100Custom.xml file:

    <properties>
    <common merge="mergeChildren">
    <jsonp-enabled>true</jsonp-enabled>
    </common>
    </properties>

    Hope this helps...

    Phil
  • padamstx
    padamstx
    51 Posts

    Re: Enabling JSONP on BPM 7.5.1

    ‏2012-01-08T05:12:02Z  
    • padamstx
    • ‏2012-01-08T04:53:23Z
    The general instructions for updating your 100Custom.xml file are located in the InfoCenter, here.

    The 99Local.xml file contains the default value of various configuration parameters. You'll find the "jsonp-enabled" element within the "common" element in this file. So, to enable JSONP support, you would need to add something like this in 100Custom.xml file:

    <properties>
    <common merge="mergeChildren">
    <jsonp-enabled>true</jsonp-enabled>
    </common>
    </properties>

    Hope this helps...

    Phil
    Correction:
    The 100Custom.xml file should look like this:
    
    <properties> <common merge=
    "mergeChildren"> <jsonp-enabled merge=
    "replace">true</jsonp-enabled> </common> </properties>
    


    One additional trick... after you start up the server, you can check on the configuration that it's using by looking at the TeamWorksConfiguration.running.xml file located in the <profile-root>/config/cells/<cellname>/nodes/<nodename>/servers/<servername>/process-server directory. This will help you verify that you have the properties set correctly.

    Phil
  • r_olivieri
    r_olivieri
    61 Posts

    Re: Enabling JSONP on BPM 7.5.1

    ‏2012-01-17T17:26:17Z  
    • padamstx
    • ‏2012-01-08T05:12:02Z
    Correction:
    The 100Custom.xml file should look like this:
    <pre class="jive-pre"> <properties> <common merge= "mergeChildren"> <jsonp-enabled merge= "replace">true</jsonp-enabled> </common> </properties> </pre>

    One additional trick... after you start up the server, you can check on the configuration that it's using by looking at the TeamWorksConfiguration.running.xml file located in the <profile-root>/config/cells/<cellname>/nodes/<nodename>/servers/<servername>/process-server directory. This will help you verify that you have the properties set correctly.

    Phil
    Thanks for the response; that worked.