Reputation: 45
I'm trying to invoke the adapter "PushAdapter" from the example project Module_07_04_nativeAPIForiOSPush from my local Worklight Studio (version 6 with fix pack 1) and getting the below error in the browser:
/*-secure-
{"errors":["I O: Unexpected character 'd' on line 1,
column 27"],"isSuccessful":false,"warnings":[],"info":[]}*/
The URL I'm using is:
http://192.168.1.106:10080/Module_07_04_nativeAPIForiOSPush/invoke?adapter=PushAdapter&procedure=submitNotification¶meters=['worklight,'doesitwork']
I looked in the local Worklight server messages.log and it's throwing this error:
[10/2/13 9:34:11:179 EDT] 0000078f
om.worklight.integration.services.impl.DataAccessServiceImpl E FWLSE0013E: Cannot invoke
procedure PushAdapter/submitNotification [project Module_07_04_nativeAPIForiOSPush]
java.io.IOException: Unexpected character 'd' on line 1, column 27
at com.ibm.json.java.internal.Tokenizer.next(Tokenizer.java:129)
at com.ibm.json.java.internal.Parser.parseValue(Parser.java:208)
at com.ibm.json.java.internal.Parser.parseArray(Parser.java:162)
at com.ibm.json.java.internal.Parser.parseValue(Parser.java:230)
...
There are a few other posts indicating similar issues parsing the Json objects/arrays. So, I changed the return value to only return an empty object:
return {};
But, still same error. Running it via the Worklight Studio (Run As...|Invoke Worklight Procedure) displays:
{
"isSuccessful": true
}
I'm intending to use this approach (GET request from an external app to the Worklight server) to run notifications push, but, if a basic GET request doesn't work, I'll have to look for another approach.
Question 1: Is this the correct Http GET format? Question 2: For notifications push scheduling, is this a typical approach?
Upvotes: 0
Views: 1148
Reputation: 1416
Looks like a typo in the URL. Missing a quote after worklight.
Upvotes: 1