The Java EE 6 Tutorial

Building, Packaging, and Deploying the Service

You can build, package, and deploy the helloservice application by using either NetBeans IDE or Ant.

ProcedureTo Build, Package, and Deploy the Service Using NetBeans IDE

  1. In NetBeans IDE, select File->Open Project.

  2. In the Open Project dialog, navigate to:


    tut-install/examples/jaxws/
    
  3. Select the helloservice folder.

  4. Select the Open as Main Project check box.

  5. Click Open Project.

  6. In the Projects tab, right-click the helloservice project and select Deploy.

    This command builds and packages the application into helloservice.war, located in tut-install/examples/jaxws/helloservice/dist/, and deploys this WAR file to the GlassFish Server.

Next Steps

You can view the WSDL file of the deployed service by requesting the URL http://localhost:8080/helloservice/HelloService?wsdl in a web browser. Now you are ready to create a client that accesses this service.

ProcedureTo Build, Package, and Deploy the Service Using Ant

  1. In a terminal window, go to:


    tut-install/examples/jaxws/helloservice/
    
  2. Type the following command:


    ant
    

    This command calls the default target, which builds and packages the application into a WAR file, helloservice.war, located in the dist directory.

  3. Make sure that the GlassFish Server is started.

  4. Type the following:


    ant deploy
    
Next Steps

You can view the WSDL file of the deployed service by requesting the URL http://localhost:8080/helloservice/HelloService?wsdl in a web browser. Now you are ready to create a client that accesses this service.