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
New Developer
Posts: 27
Registered: ‎05-20-2012
My Device: Dev Alpha B, C and Playbook
My Carrier: PLAY
Accepted Solution

Loading data from external XML file

Hello folks!

 

I have a XML file on my server, updated by cron every 10 minutes and i want load data to my webworks app from it, but ajax jquery function does not support cross domains. So here is my question - how should get this data? Can i somehow download this file and then use ajax?

 

Greets!

Contributor
Posts: 33
Registered: ‎01-17-2013
My Device: BB10 Dev Alpha Sim
My Carrier: Verizon

Re: Loading data from external XML file

in your config.xml, add a permission to access your server:

 

<access uri="http://www.yourserver.com" subdomains="true" />

 

this will get by the cross origin issues.

Developer
Posts: 322
Registered: ‎08-06-2012
My Device: Dev Alpha / Playbook / Curve 9300

Re: Loading data from external XML file

I know its crazy long thread and a bit complicated but try get your head around this:

http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/why-it-goes-to-if-condiation/td-...

 

It uses a js called soapclient which was the one way I could get to read external XML.  It also explains how to bypass the whole browser protection blocking CORS.

If it helped you, click like. Smiley Happy
Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: Loading data from external XML file

@RichardRahl: Did either of the above help resolve the issue? If so, please accept the corresponding response as the solution.

If not, fire away with any additional questions you may have. If you're able to provide a "Hello World" sample config.xml and index.html that can be used to reproduce the issue, I'd be happy to test on my end and provide some feedback as well.

Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
Developer
Posts: 554
Registered: ‎10-31-2009
My Device: Torch 9800, Bold 9700
My Carrier: Movistar, Telenor

Re: Loading data from external XML file

I have been struggling with file download for quite some time. The simplest solution I have found is to use XMLHttp for download and then use a "writer"  to get it to the file system.  I have some sample cod if you want

If everything seems to be under control, you're just not driving fast enough
-Mario Andretti-