[GRP-437] Add JSONP support to Grouper-WS Created: 21/May/10 Updated: 20/Mar/12 Resolved: 20/Mar/12 |
|
Status: | Resolved |
Project: | Grouper |
Component/s: | WS |
Affects Version/s: | None |
Fix Version/s: | 2.1.0 |
Type: | Improvement | Priority: | Minor |
Reporter: | David Langenberg | Assignee: | Chris Hyzer (upenn.edu) |
Resolution: | Fixed | Votes: | 0 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
web |
Description |
It would be nice if grouper-ws supported JSONP for AJAX apps which do not live on the server hosting the grouper-ws-api. |
Comments |
Comment by mchyzer [ 19/Oct/10 ] |
Just curious, David, what changes need to happen on the server side to support this? Thanks, |
Comment by langedb [ 19/Oct/10 ] |
Basically, the server needs to be able to accept a new parameter on all calls Pseudo Example non-JSONp: Returned: {foo: bar, baz: qux}Pseudo Example JSONp GET http://server/getStuff?callback=someQueryResults Returned: someQueryResults( {foo: bar, baz: qux}) On the client side, a function someQueryResults will exist which will take the Dave |
Comment by langedb [ 20/Mar/12 ] |
Just curious if there is any movement on this. |
Comment by mchyzer [ 20/Mar/12 ] |
This is fixed. Note, if you want to disable this functionality, set this in the grouper-ws.properties ws.allowJsonWrapper = false If this is the request (could be any operation): POST /grouper-ws/servicesRest/v2_1_000/subjects?grouperJsonResponseWrapper=something HTTP/1.1 {"WsRestGetGroupsRequest":{"subjectAttributeNames":["description"],"subjectLookups":[ {"subjectId":"test.subject.0"}, {"subjectId":"test.subject.1"}]}} Then this is the response: HTTP/1.1 201 Created something({"WsGetGroupsResults":{"responseMetadata": {"millis":"223","serverVersion":"2.1.0"},"resultMetadata": {"resultCode":"SUCCESS","resultMessage":"Success for: clientVersion: 2.1.0, subjectLookups: Array size: 2: [0]: WsSubjectLookup[subjectId=test.subject.0]\n[1]: WsSubjectLookup[subjectId=test.subject.1]\n\nmemberFilter: All, includeGroupDetail: false, actAsSubject: null\n, params: null\n fieldName1: null\n, scope: null, wsStemLookup: null\n, stemScope: null, enabled: null, pageSize: null, pageNumber: null, sortString: null, ascending: null\n, pointInTimeFrom: null, pointInTimeTo: null","success":"T"},"results":[{"resultMetadata": {"resultCode":"SUCCESS","success":"T"},"wsSubject":{"attributeValues":["description.test.subject.0"],"id":"test.subject.0","name":"my name is test.subject.0","resultCode":"SUCCESS","sourceId":"jdbc","success":"T"}},{"resultMetadata": {"resultCode":"SUCCESS","success":"T"},"wsSubject":{"attributeValues":["description.test.subject.1"],"id":"test.subject.1","name":"my name is test.subject.1","resultCode":"SUCCESS","sourceId":"jdbc","success":"T"}}],"subjectAttributeNames":["description"]}}) |