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 HttpRequest to connect to the web service.
  • Use PullParser to 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

Examples of Accessing RSS Feeds

Examples of Accessing SOAP Web Services

  • My Web Service Approach New window
    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 New window
    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]



Rate This Article
Leave a Comment or Suggest a Topic

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 replies—your information is not used for any other purpose. By submitting a comment, you agree to these Terms of Use.

 

English
日本語
한국어
简体中文
русский
Português do Brasil