Can I use jsonwebservice for jsonp webservice

42 views
Skip to first unread message

David

unread,
Jun 13, 2012, 3:28:20 AM6/13/12
to jsonweb...@googlegroups.com
hi, 
I user jsonwebservice at my webservice, it is great.
thank you .

now I want to make a jsonp support at my webservice.

now  i get the response like this.

{'return':{'XXX':yyy},'statusFlag'true}


can i get the result like this ?
callback("{'XXX':yyy}")

thanks
David 

a Chinese working in Japan Speaking English

Sundar Murthi

unread,
Jun 13, 2012, 3:44:37 AM6/13/12
to jsonweb...@googlegroups.com
Hi David,
Thank you for posting. I believe due to security issues responses directly not allowed to invoke callback method.

You can use your response callback method like "onSuccess" or "done" on jquery or other relevant framework ajax callback methods.


Hope it helps.



On Jun 13, 2012, at 9:28 AM, David wrote:

>

David

unread,
Jun 13, 2012, 4:05:19 AM6/13/12
to jsonweb...@googlegroups.com
hi,
thank you for reply!

the response format that i hoped is for crossdomain .

i can not access the webservice in the other domain with ajax.

the work that invoke callback method is done by jquery 
"callback("{'XXX':yyy}")" is return as a string

regards

David

Sundar Murthi

unread,
Jun 13, 2012, 4:21:23 AM6/13/12
to jsonweb...@googlegroups.com
Hi David,
 You may try including jquery client javaScript from the API server and access the call balk.


<head>
<script src="http://aomain/API/1_0/port.json?client "></script>
</head>

and using service variable you can access the api methods.

Note: API server must include jquery support jar to generate this js client.

David

unread,
Jun 13, 2012, 6:03:27 AM6/13/12
to jsonweb...@googlegroups.com
hi,
thanks for the cool idea.

i make a webgl project and get the 3D data from server.
everytime i get more than 40M data by json.

so,if i use a server proxy for cross domain,
it will cost much time for the travel of the big data.

maybe , i can add a request filter and edit the response string of json,
make the json to "callback("{'XXX':yyy}")" 

i will try it and report the result here.

regards


2012年6月13日水曜日 17時21分23秒 UTC+9 jsonwebservice:
Reply all
Reply to author
Forward
0 new messages