Home Application-development Java 7 JAX-WS Web Services

Java 7 JAX-WS Web Services

By Deepak Vohra
books-svg-icon Book
Subscription
$10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
BUY NOW $10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
Subscription
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
About this book

Web services are applications that use open, XML-based standards and transport protocols to exchange data with clients.

In the book Developing a JAX-WS Web Service using the wsimport clientjar Option, we shall create a JAX-WS web service with Java 7. We shall discuss the new clientjar option in the wsimport tool or the wsimport ant task which is used to generate JAX-WS portable artifacts from a service wsdl. Subsequently, we use the web service artifacts to invoke the web service from a web service client.

Publication date:
May 2012
Publisher
Packt
Pages
64
ISBN
9781849687201

 

Chapter 1. Setting the Environment

For developing a JAX-WS web service with Java 7, we shall be using NetBeans IDE 7 and Oracle GlassFish Server 3.1.1, both of which support Java 7. In this chapter we shall install the software required for this book. The Windows version of the software (.exe application) is used in this book. If using another OS, install the corresponding version of the software if available.

Installing the Oracle GlassFish Server

Download the Oracle GlassFish Server 3.1.1 or the latest version Open Source Edition .exe file from http://www.oracle.com/technetwork/java/javaee/downloads/ogs-3-1-1-downloads-439803.html. Double-click on the .exe file to start the installation. The installation gets initialized, as shown in the following screenshot:

In the Introduction window, click on Next.

In the Installation Type window, select Typical Installation. Ports 4848 and 8080 must be available. For example, if the Oracle database XE is installed and running, the database needs to be stopped. Click on Next:

In the Install Directory window, specify an Installation Directory (C:/glassfish3) and click on Next. The directory does not need to be created prior to specifying the Installation Directory:

If GlassFish Server updates need to be installed, select the Install Update Tool checkbox. Select the Enable Update Tool to enable the update tool. As we won't be using the Update Tool for the sample application in the book, in Update Tool deselect Install Update Tool and click on Next.

In the Ready To Install window, click on Install to install and configure the Oracle GlassFish Server Open Source Edition:

The installation of GlassFish Server 3.1.1 starts and the Progress bar indicates the percentage installed:

The Config Results window shows whether the required configuration domain (domain1) is created or not. If the domain creation fails with the error: "The system cannot find the path specified", running the installer with the -j JAVA_HOME option fixes this issue.

The start-domain command gets invoked:

As shown in the following screenshot, the domain domain1 starts successfully. The Admin Port is 4848:

The Oracle GlassFish Server is now installed and configured. Click on Exit:

The GlassFish Server Administration server console may be accessed with the URL http://localhost:4848/common/index.jsf:

The application server may also be started/stopped from the Windows | Start program menu:

The server can be accessed at http://localhost:8080.

 

Installing the Oracle GlassFish Server


Download the Oracle GlassFish Server 3.1.1 or the latest version Open Source Edition .exe file from http://www.oracle.com/technetwork/java/javaee/downloads/ogs-3-1-1-downloads-439803.html. Double-click on the .exe file to start the installation. The installation gets initialized, as shown in the following screenshot:

In the Introduction window, click on Next.

In the Installation Type window, select Typical Installation. Ports 4848 and 8080 must be available. For example, if the Oracle database XE is installed and running, the database needs to be stopped. Click on Next:

In the Install Directory window, specify an Installation Directory (C:/glassfish3) and click on Next. The directory does not need to be created prior to specifying the Installation Directory:

If GlassFish Server updates need to be installed, select the Install Update Tool checkbox. Select the Enable Update Tool to enable the update tool. As we won't be using the Update Tool for the sample application in the book, in Update Tool deselect Install Update Tool and click on Next.

In the Ready To Install window, click on Install to install and configure the Oracle GlassFish Server Open Source Edition:

The installation of GlassFish Server 3.1.1 starts and the Progress bar indicates the percentage installed:

The Config Results window shows whether the required configuration domain (domain1) is created or not. If the domain creation fails with the error: "The system cannot find the path specified", running the installer with the -j JAVA_HOME option fixes this issue.

The start-domain command gets invoked:

As shown in the following screenshot, the domain domain1 starts successfully. The Admin Port is 4848:

The Oracle GlassFish Server is now installed and configured. Click on Exit:

The GlassFish Server Administration server console may be accessed with the URL http://localhost:4848/common/index.jsf:

The application server may also be started/stopped from the Windows | Start program menu:

The server can be accessed at http://localhost:8080.

 

Installing NetBeans IDE 7


Download the NetBeans 7.0.1 or the latest version of Java EE Installer for Windows .exe file from http://netbeans.org/downloads/index.html. Double-click on the .exe application. The NetBeans IDE 7.0.1 Installer initializes. The NetBeans IDE Java EE version comes embedded with the GlassFish Server and Tomcat. The GlassFish Server may be installed with NetBeans IDE or separately. As we already installed the standalone version of the Oracle GlassFish Server, deselect the checkbox for the GlassFish Sever and also deselect the checkbox for the Apache Tomcat server. Click on Next:

In the License Agreement window, select the checkbox to accept the agreement and click on Next. Accept the JUnit License Agreement and click on Next.

Choose the installation folder for NetBeans IDE 7.0.1 and JDK 1.7.0, and click on Next:

The Summary of the installation is then displayed. Click on Install:

The installation of the NetBeans IDE and Java EE runtime environment begins:

When the installation completes, click on Finish.

 

Summary


In this chapter we downloaded and installed the Oracle GlassFish Server 3.1.1 and NetBeans IDE 7.0.1.

In the next chapter, we will develop a JAX-WS web service with the Java 7 wsimport task.

About the Author
  • Deepak Vohra

    Deepak Vohra is consultant and principle a member of the NuBean software company. He is a Sun Certified Java Programmer (SCJP) and Sun Certified Web Component Developer (SCWCD) and has worked in the fields of XML, Java programming, and J2EE for over 10 years. He is the coauthor of the Apress book Pro XML Development with Java Technology. Deepak is the author of several Packt Publishing books, including Processing XML documents with Oracle JDeveloper 11g and Java EE Development with Eclipse. Deepak is also a Docker Mentor and has published four other Docker-related books.

    Browse publications by this author
Latest Reviews (1 reviews total)
Great book to get up to speed with Web Services, lookup references and etc.. Would be even better to see a chapter how to integrate Web Services with dependency injection frameworks such as Guice and Spring. The chapter on testing was not sufficient. I would have loved to see a unit test with an embedded Jetty instead of depending on a an application server such as Glassfish.
Java 7 JAX-WS Web Services
Unlock this book and the full library FREE for 7 days
Start now