How-To's > How do I connect to a web service or RSS feed?
You can access both RESTful and SOAP-based web services. Of the two, RESTful web services are easier to access. See the following examples for accessing both types of web services, as well as RSS feeds.
RESTful web services provide data in two formats: XML and JSON, both of which are supported by JavaFX technology. Perform the following basic steps to access a RESTful web service:
- Create a custom class with variables that match the data that will be obtained from the web service
- Use
HttpRequestto connect to the web service. - Use
PullParserto parse the XML or JSON data.
Accessing RSS feeds works in a similar fashion: Access the data by using HttpRequest and parse the XML data with PullParser.
Examples of Accessing RESTful Web Services
- JavaFX - WebServices
Provides basic code for theHttpRequestandPullParsercomponents of accessing a RESTful web service. - JavaFX Flickr Client
Accessing Flickr's REST API From JavaFX
Animating Photos from Flickr
ScreenshotMaker: Capture, Edit, and Upload a Screen to Flickr or Save It to Disk
Four sample applications that show how to retrieve and display photos from Flickr by using the Flickr REST API. - Get All-Weather Forecasts With Yahoo APIs
Get All-Weather Forecasts With Yahoo APIs for Mobile
Shows how to access the Yahoo Weather Web Service, parse the XML data, and use it to create a 3-D chart for both desktop and mobile applications. - Increasing Your Contacts With a Customized JavaFX Address Book
Shows how to display address book contacts on a Yahoo map. - Location-Based Coffee Shop Search With Yahoo Webservices
Shows how to access Yahoo Local Search Web Services to display a list of local coffee shops. - JavaFX Twitter Client
Shows how to create a Twitter client by using the Twitter REST API.
Examples of Accessing RSS Feeds
- Getting Weather Forecast from Yahoo!
Shows how to access the Yahoo Weather RSS feed.
Examples of Accessing SOAP Web Services
- JavaFX + WebStart + Web Services + GlassFish = One cool client app

Describes deployment of a JavaFX Web Start client that accesses data from a SOAP web service.
API Documentation
Last Updated: April 2010
[Return to How-To's Home]