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. - Invoke RESTful Web Services from JavaFX

Demonstrates how to access RESTful web services. - Media Browser, Module 3 Task 1: Retrieving Media Using Web Services
Shows how to search for media by using the Yahoo Search 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. - Shopping Mashup
This mashup shows how to map Delicious tags onto a pie chart, then click on a segment of the pie chart to display products available in that category from the Yahoo Shopping Web Service. - 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
- My Web Service Approach

Shows how to create a web service client in the Eclipse IDE, which creates a number of Java files that can be used to interact directly with an Amazon Web Services WSDL. The Java files can be incorporated into a JavaFX application and eliminate the need to parse XML or JSON data. - 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: November 2009
[Return to How-To's Home]
Do you have comments about this article? We welcome your participation in our community. Please keep your comments civil and on point. You may optionally provide your email address to be notified of repliesyour information is not used for any other purpose. By submitting a comment, you agree to these Terms of Use.