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
Trusted Contributor
foufou
Posts: 109
Registered: ‎11-15-2011
My Carrier: beginner developer
Accepted Solution

create http client to get data from web service

Hi,

I'm newbie on workingwith webworks. I have to get data from web service. How can I connect on this service and parse it. There is a tutoriel that can help me to start with it.

Can any one advice me how can I start to work with webworks on blackberry 10

Thanks for any help

Please use plain text.
Developer
peardox
Posts: 1,227
Registered: ‎03-20-2011
My Carrier: 3, Orange, Vodafone

Re: create http client to get data from web service

In general you need to use an AJAX call to the server

 

It really depends on what the server returns as to how easy the information is to digest

 

JQuery provides a simple interface and returns easy to use information

 

If you're dealing with XML things can get complicated depending on namespace

 

If you look at the raw XML and it goes something like fred:name you will have issues that require a SAX implementation - JSON is dead easy if you get that though (nothing too confusing there)

 

If using an external data source go for JSON if you have the choice

 

As far as examples go - just look up JQuery Ajax [JSON / XML] and you'll get where you're going rapidly

 

SAX is a LOT harder owing to the namespace - the most common is Dublin and even XML without namespace is not simple to handle so avoid it if you can




Click the like button if you find my posts useful!
Please use plain text.
BlackBerry Development Advisor
oros
Posts: 1,453
Registered: ‎04-12-2010
My Carrier: Bell

Re: create http client to get data from web service

I'm accepting peardox's response as a solution as it outlines the components required to make a web service request via AJAX and provides information about samples.

There is also a basic W3C sample here using AJAX and a PHP server that returns database information:
http://www.w3schools.com/php/php_ajax_database.asp

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.
Please use plain text.