Rebecca Searls' Blog
Mobilizing a Webservice using JAX-RS connector in Sun GlassFish Mobility Platform 1.1 - Part I
Sun GlassFish Mobility Platform 1.1 has just been released and it has many great new features. One particularly noteworthy feature is the addition of a new type of connector, the JAX-RS connector. This new framework is based on the RESTFul Web Service (JAX-RS) standard. By design, it works with any type of business object, making it possible to implement the connector as a single web application that can be accessed by the gateway for synchronization or by the client directly for any other reason. This design makes it quite simple to tap into existing corporate data and make that data mobile.
I was excited to try out this new API. In my search for some pre-existing data that would interest a wide audience, I found Salesforce, a company that provides a free 90-day developer account for evaluation and a web service to their repositories. This was ideal because it enabled me to implement the connector so anyone with a Salesforce developer account who is running the Sun GlassFish Mobility Platform 1.1 software can access their own account data either by writing their own application to talk to the connector or by running our client application.
The Salesforce connector is pre-installed in the Sun GlassFish Mobility Platform 1.1 release. It is a demonstration of the JAX-RS connector features; it is not production grade. Only a subset of Salesforce account, contact, and task data is made available to the client application by this connector. The connector supports creating, updating, and deleting task data, as well as updating contact data and reading, but not modifying or deleting, account data.
Before we examine the connector design and explore some of the implementation challenges, let's take the connector and client application for a test drive. Here's what you need to do:
- Download Sun GlassFish Mobility Platform 1.1 and the client bundle available here.
- Install Sun GlassFish Mobility Platform 1.1. The installation process first installs GlassFish v2.1 and then Sun GlassFish Mobility Platform. The Salesforce connector is a default component in this release. There are no special steps you need to take to activate it. It is running when the installation completes.
- Get a Salesforce Developer account by registering at http://SalesForce.com/developer.
- Get a security key for your Developer account. The security key is required to be used with the web service.
-
- Login to your Salesforce Developer account.
- Select the "Setup" link at the top of the page.
- Select the "Reset your security token" text on this page.
- Follow the directions. A security key will be emailed to you.
- Unzip the client bundle and find the salesforce-ws.jad and salesforce-ws.jar files.
- Follow the directions provided in the section, "Deploying the Salesforce Sample Client Application" of the Deployment Guide available here to run the client.
Here are some screen shots of the Salesforce client application.
Login Screen List of accounts in my developer account

Company GenePoint account details
A GenePoint Contact
A Task on GenePoint
In Part II, I'll discuss the JAX-RS connector interfaces.
Posted at 10:58AM Feb 18, 2009 by rsearls in Sun | Comments[2]
Wednesday Feb 18, 2009
Posted by Ryan Shoemaker's Blog on February 27, 2009 at 02:14 PM EST #
can you use the the JAX-RS connector with JavaFX?
Posted by Carol McDonald on April 13, 2009 at 01:59 PM EDT #