Reader small image

You're reading from  Java EE 7 Development with NetBeans 8

Product typeBook
Published inJan 2015
Reading LevelIntermediate
PublisherPackt
ISBN-139781783983520
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
David R Heffelfinger
David R Heffelfinger
author image
David R Heffelfinger

David Heffelfinger is the Chief Technology Officer of Ensode Technology, LLC, a software consulting firm based in the greater Washington DC area. He has been architecting, designing, and developing software professionally since 1995, and has been using Java as his primary programming language since 1996. He has worked on many large-scale projects for several clients including the US Department of Homeland Security, Freddie Mac, Fannie Mae, and the US Department of Defense. He also has a Masters degree in Software Engineering from Southern Methodist University. David is Editor-in-Chief of Ensode.net (http://www.ensode.net), a website about Java, Linux, and other technology topics.
Read more about David R Heffelfinger

Right arrow

Generating RESTful Java client code


NetBeans provides a wizard that can automatically generate client Java code that invokes our RESTful web service methods via the corresponding HTTP requests.

To generate this client code in a Java application project, we simply need to go to File | New File, select the Web Services category, and select RESTful Java Client as the file type.

In the next step in the wizard, we need to enter a class name and a package name for our JAX-RS client.

Note

Jersey is the JAX-RS implementation included with GlassFish. Since we are using the GlassFish application server included with NetBeans, NetBeans uses a default name NewJerseyClient for the Class Name field; this default class name will suffice for our purposes.

Then, we need to select the RESTful web service that our client will consume. In our case, we need to select the From Project radio button under Select the REST resource and click on the button labeled Browse.

Then, we simply need to select the RESTful web service...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Java EE 7 Development with NetBeans 8
Published in: Jan 2015Publisher: PacktISBN-13: 9781783983520

Author (1)

author image
David R Heffelfinger

David Heffelfinger is the Chief Technology Officer of Ensode Technology, LLC, a software consulting firm based in the greater Washington DC area. He has been architecting, designing, and developing software professionally since 1995, and has been using Java as his primary programming language since 1996. He has worked on many large-scale projects for several clients including the US Department of Homeland Security, Freddie Mac, Fannie Mae, and the US Department of Defense. He also has a Masters degree in Software Engineering from Southern Methodist University. David is Editor-in-Chief of Ensode.net (http://www.ensode.net), a website about Java, Linux, and other technology topics.
Read more about David R Heffelfinger