Page 2 of 2

Jsonp service doesn't works

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

I don't know why your service returns that. In, Test the request is sent from a server. On a page is it sent from JavaScript. You need to check the service and see what the difference is in request and why different responses are created.


Jsonp service doesn't works

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

-FROM TIGGZI TEST the response is:
{
"success": true,
"description": "success"
}

for that request on my server I have this:

[2012/06/22 19:35:46 JsonServlet] SB = {"cantiere":"","sent_dt":"","commessa":"","card_id":""}
[2012/06/22 19:35:46 JsonServlet] JSON OBJECT : card_id commessa cantiere sent_dt

and everything work fine.

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

-FROM WEB BROWSER the response on console is:
{"success":false}

and for that request on my server I have this:
[2012/06/22 19:29:38 JsonServlet] SB =
[2012/06/22 19:29:38 JsonServlet] Exception = null

strange :-( ....


Jsonp service doesn't works

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

Check the request and how it's encoded. Encoding might be different from the server (proxy) and from a page.


Jsonp service doesn't works

Posted: Fri Jun 22, 2012 9:30 pm
by Paolo

-Request from tiggzi test is this:

POST /seam/resource/amf HTTP/1.1
Host: tiggzi.com
Proxy-Connection: keep-alive
Content-Length: 768
Origin: http://tiggzi.com
User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5
content-type: application/x-amf
Accept: /
Referer: http://tiggzi.com/resources/swf/TigrW...
Accept-Encoding: gzip,deflate,sdch
Accept-Language: it,en-US;q=0.8,en;q=0.6
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: __qca=P0-10774978-1340006406924; JSESSIONID=B2AB50DAF4D616FC3887133C1A7D90ED; __utma=169854756.1944930405.1339677998.1340384568.1340396741.30; __utmb=169854756.3.10.1340396741; __utmc=169854756; __utmz=169854756.1339677998.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)

null /141 ê
Oflex.messaging.messages.RemotingMessage
source operation timeToLive messageId body headers clientId destination timestamp testConnection
IFE0B021A-F2B3-A90F-789E-15FA3C339845
[http://www.myserver.com/WebSqlSms/Jso... post jsonp json 0 ...inputParameters
entry id="1" path="card_id" defaultValue="" header="false" array="false"/
entry id="2" path="commessa" defaultValue="" header="false" array="false"/
entry id="3" path="cantiere" defaultValue="" header="false" array="false"/
entry id="4" path="sent_dt" defaultValue="" header="false" array="false"/
/inputParameters
DSId I2425F830-A4E4-40B8-A81E-F74F4519C40C DSEndpoint seam-amf I2634D085-9012-43E9-9EA0-40F5DA310F17
'restServiceEndpoint

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

-Request from web browser is this:

GET /WebSqlSms/JsonServlet?callback=jQuery16402064820583858259_1340394632708&{%22card_id%22:%22AA3CF88B%22,%22commessa%22:%22999999%22,%22cantiere%22:%221234%22,%22sent_dt%22:%222012/06/19%2010:48:23%22} HTTP/1.1
Host: www.myserver.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20100101 Firefox/12.0
Accept: /
Accept-Language: en,en-us;q=0.5
Accept-Encoding: gzip, deflate
Proxy-Connection: keep-alive
Referer: http://tiggzi.com/view/....
Cookie: __utma=42561188.2032589320.1338655906.1338655906.1338655906.1;
__utmz=42561188.1338655906.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)

Look the first is POST request and second is a GET....
and the Accept-Encoding is different...

do you have any idea?
thanks


Jsonp service doesn't works

Posted: Fri Jun 22, 2012 9:40 pm
by Paolo

in the first request I unput the < becasue the forum can't read that tag


Jsonp service doesn't works

Posted: Fri Jun 22, 2012 9:40 pm
by maxkatz

When using JSONP, you can only do a GET.


Jsonp service doesn't works

Posted: Fri Jun 22, 2012 9:40 pm
by Paolo

in the first request I unput the < becasue the forum can't read that tag entry with <


Jsonp service doesn't works

Posted: Sat Jun 23, 2012 8:38 am
by Paolo

When using JSONP, you can only do a GET.

ok but then why tiggzi test send a POST (as you can see in the request above) with JSONP and not a GET?
would be a test so everything must be the same in the request like request from browser
if not it is not a really test, it's another kind of request but nobody can trust about this test,
isn't it?


Jsonp service doesn't works

Posted: Sun Jun 24, 2012 1:31 am
by maxkatz

JSONP can only be done from a page. Even though you are doing a POST and specified JSONP, because the request is coming from a server (not page), regular JSON is used.