Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Regular Contributor
hoangan_it
Posts: 63
Registered: ‎06-08-2012
My Device: BlackBerry
My Carrier: BlackBerry

How to call Webservice JSON method="POST", Webworks App

Hi everyone,

 

I want to call webservice (ws) json method='post'

My app install on playbook and call webservice on my server

 

I used jsonp to call ws method='get' is working well (because jsonp support call ws cross domain).

Unfortunaterly, jsonp does not support to call ws method='post'

 

I have tried to use javascript and $.ajax to call ws, but it is working on IE and not on Chrome.

I use Ripple Emulator on Chrome to test my webworks app, so I can not call ws method='post'.

I think this is the issue about cross domain.

 

Could you help me to call ws json method='post' on Chrome.

Expect your response soon!

 

Best regards,

An Pham

 

 

Please use plain text.
Developer
nathanpc
Posts: 134
Registered: ‎05-19-2012
My Device: Torch 9800, PlayBook 64GB, Dev Alpha
My Carrier: VIVO Brazil

Re: How to call Webservice JSON method="POST", Webworks App

[ Edited ]

WebWorks has no restrictions about cross-domain calls so don't worry. The only problem is when you're debugging on Chrome (and other browsers too) which has a restriction to cross-domain requests in order to protect your computer, but in this case you can disable this to debug your web app.

 

If you're on a Mac just execute this command:

 

sudo "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --disable-web-security --allow-file-access-from-files

On other OSes just execute Chrome with the --disable-web-security --allow-file-access-from-files arguments.

 

 

If I was helpful don't forget to click the Like button to support my work. :smileyhappy:

If I helped you please click the "Like" button to support my work.
My apps: CherryNotes - Bookmarked - Requests
Social Me: about.me - Twitter
Please use plain text.
Regular Contributor
hoangan_it
Posts: 63
Registered: ‎06-08-2012
My Device: BlackBerry
My Carrier: BlackBerry

Re: How to call Webservice JSON method="POST", Webworks App

:Genius: Hi nathanpc,

Thanks so much for your good opinion!

 

I will try to deploy my webworks app on playbook to test call ws method='post' which I have mentioned.

But I have a other issue, can you help me again ^^:

 

This is issue: How to deploy webworks app on playbook

 

I have successfully created a debug token.

After that, I installed it on playbook successfully.

 

You see on page :http://yllus.com/2011/06/18/deploying-a-blackberry-webworks-app-to-the-playbook-windows/

I have just deploy my webworks app on my playbook follow this guide!

I try to implement step to step,

 

The cmd line of the "Step Ten":

C:\Program Files\Research In Motion\blackberry-tablet-sdk-1.1.1\bin>blackberry-deploy -installApp -password playbook -device 169.254.0.1 -package D:\C\device\Converter.bar
Info: Sending request: Install
Info: Action: Install
Info: File size: 2269
Info: Installing ...
Info: Processing 2269 bytes
actual_dname::debug.token.gYABgHN2sVepeOFu_NXRX7cfZTU
actual_id::gYABgHN2sVepeOFu_NXRX7cfZTU
actual_version::0.0.0.3
result::success

 

But my webworks app is not apeared on my playbook!

Could you show me the reason?

 

I am expecting your respone soon!

 

Best Regards,

An Pham

 

Please use plain text.
Developer
nathanpc
Posts: 134
Registered: ‎05-19-2012
My Device: Torch 9800, PlayBook 64GB, Dev Alpha
My Carrier: VIVO Brazil

Re: How to call Webservice JSON method="POST", Webworks App

Hmm, sorry I don't have much experience with Playbook deployment errors.
If I helped you please click the "Like" button to support my work.
My apps: CherryNotes - Bookmarked - Requests
Social Me: about.me - Twitter
Please use plain text.
Administrator
astanley
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: How to call Webservice JSON method="POST", Webworks App

Hi An,

 

When you compiled your WebWorks app, did you use the -d command line argument (enable Web Inspector)?  This flag is necessary when using Debug Tokens as it injects the appropriate author info for your debug token files.

 

 

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Please use plain text.
Regular Contributor
hoangan_it
Posts: 63
Registered: ‎06-08-2012
My Device: BlackBerry
My Carrier: BlackBerry

Re: How to call Webservice JSON method="POST", Webworks App

Hi astanley,

As nathanpc mentioned,

It is working well on playbook. Although, it is not working in chrome (ripple) as cross domain problem ^^
Please use plain text.
Regular Contributor
hoangan_it
Posts: 63
Registered: ‎06-08-2012
My Device: BlackBerry
My Carrier: BlackBerry

Re: How to call Webservice JSON method="POST", Webworks App

Hi astanley,

I just deploy my webworks app on playbook successfully! ^^
Please use plain text.
Regular Contributor
hoangan_it
Posts: 63
Registered: ‎06-08-2012
My Device: BlackBerry
My Carrier: BlackBerry

Re: How to call Webservice JSON method="POST", Webworks App

Hi astanley,

Would you mind to show me the way to open avaible list photo on my play book then I will select one to display it on my app?

See your response soon! ^^
An Pham
Please use plain text.