Page 1 of 2

Jsonp service doesn't works

Posted: Fri Jun 22, 2012 8:38 am
by Paolo

Hi,
I have a problem with my service jsonp:
My aplication has a client that would run on the mobilephone and a web services json on the server (I used Gson of google for my servlet).

why if I click button "Test connection" in the section "Request Parameters" in tigzzi the service jsonp works and
if instead I use the application on browser or in my phone the sevice does't works?

Another curios question:
How does Parse service json work without Tigzzi Proxy? The service use json e not jsonp, how does it do?

thanks million
Paolo


Jsonp service doesn't works

Posted: Fri Jun 22, 2012 8:39 am
by Paolo

On my server service json there is the request but it's empty...


Jsonp service doesn't works

Posted: Fri Jun 22, 2012 1:11 pm
by maxkatz

Does your service support JSONP?

This should help: http://help.tiggzi.com/documentation/...

Parse works without the proxy because it supports CORS.

[quote:]
On my server service json there is the request but it's empty...
[/quote]
The response is empty or request is empty?


Jsonp service doesn't works

Posted: Fri Jun 22, 2012 2:19 pm
by Paolo

This is the request:

------------------------------

GET /WebSqlSms/JsonServlet?callback=jQuery164021291600819744916_1340373924985&{"card_id":"AA3CF88B","commessa":"999999","cantiere":"1234","sent_dt":"2012/06/19%2010:48:23"} HTTP/1.1
Accept: application/javascript, /;q=0.8
Referer: http://tiggzi.com/view/.......
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; MAAU; MAAU)
Accept-Encoding: gzip, deflate
Host: www.myserver.com
Proxy-Connection: Keep-Alive

------------------------------------------

It's strange becuase on Tigzzi rest service I set a post jsonp and not a GET how you can see above.

The server received an object json empty and his response is:

{"success":false}

I already read the document thanks a lot but I didn't find a response of my problem


Jsonp service doesn't works

Posted: Fri Jun 22, 2012 2:26 pm
by maxkatz

Is this what you get back from the server:

[quote:]
{"success":false}
[/quote]

If yes, you need to check on the server why this response is returned. From your app (or via Test), the service is invoked and there is a response. As to why this response, you would need to look at how the service works.


Jsonp service doesn't works

Posted: Fri Jun 22, 2012 2:31 pm
by Paolo

but about parse I read just now :-) I didn't see before :-) thanks


Jsonp service doesn't works

Posted: Fri Jun 22, 2012 2:54 pm
by Paolo

yes it is...
ok thanks I'll chect it out


Jsonp service doesn't works

Posted: Fri Jun 22, 2012 4:56 pm
by Paolo

ok but why if I click button "Test connection" in the section "Request Parameters" in tigzzi the service jsonp works to my server and
if instead I use the application on browser or in my phone the service does't works?
the service would work in the same mode..no? what's the problem?


Jsonp service doesn't works

Posted: Fri Jun 22, 2012 5:15 pm
by maxkatz

Run the app in the browser, open JavaScript console, invoke the service and check if there are any errors there.


Jsonp service doesn't works

Posted: Fri Jun 22, 2012 5:26 pm
by Paolo

Uncaught SyntaxError: Unexpected token : JsonServlet:1

and the error of JsonServlet:1 is:

{"success":false}

but if I send the request in tigzzi with "Test connection" works everything and the server receive the request and response correct