steve5588065
Posts: 0
Joined: Tue Feb 26, 2013 6:36 am

service error unexpected token

I have a service which inserts a row into a database on my website. It tests successfully from Service test page

When I call it from my app page I get the error 'Unexpected token |' returned from service error function

In my app I have entered code in each Request parameter javascript area to return a hard coded value matching exactly the values entered in the Service Test Page

But still it fails

Any ideas?

Regards
Steve

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

service error unexpected token

Hello Steve, It could be due to this :: http://docs.appery.io/documentation/a...

steve5588065
Posts: 0
Joined: Tue Feb 26, 2013 6:36 am

service error unexpected token

I have proxy ticked for the service

It also works fine from Service test page

Also when I test within Appery using safari I get the error

'JSON parse error: unexpected identifier 'HTTP'

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

service error unexpected token

Can you post your code that you are using in Request parameters?

steve5588065
Posts: 0
Joined: Tue Feb 26, 2013 6:36 am

service error unexpected token

Hi lllya

I have deleted all links on page datasource for this service

I have entered manual values in the Request page of the datasource to match exactly what I enter in the Services test page

request parameters
product - Gift Voucher
productid - 0
price - 100
qty - 1
deviceid - 12345
appname - ozpos_app

when i call the service from button click on the page it fails
on service test page using exact same request parameters it works fine

regards
steve

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

service error unexpected token

Steve, can you share the service URL - if it's possible, so we can reproduce this problem?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

service error unexpected token

Hi Steve,

Thank you for the information, we are working on it. There is a safety problem so the link was deleted to protect your data, will be fixed asap.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

service error unexpected token

Hi Steve,

Please tick "Use Appery.io proxy" in Service settings.

steve5588065
Posts: 0
Joined: Tue Feb 26, 2013 6:36 am

service error unexpected token

Hi Katya

Use Appery.io proxy is ticked

As I explained to Illya, if I test rsCartInsert service from the service test page the service works perfectly

If I call the service from the app page from a button click, it Fails with error 'Unexpected Token |'

The request parameters on the data tab of the page have all been entered manually for testing and are exactly the same values as entered on the Service test page

But the service call fails and no new row appears in my web database where the service writes to

The App is set to Public you are more than welcome to test it yourself
The page in question is scrGiftVouchers and the service is rsCartInsert

regards
Steve

Return to “Issues”