Click Add JAR and select the JAR file in the file chooser.
If you also want to attach source code and Javadoc for the JAR file,
click Add Library instead.
Set up compilation dependencies between projects.
In the Projects window, right-click the project node and choose Properties.
Click Libraries.
Click Add Project
and select the project folder for the project that you want to add
to the project's classpath.
Create a JAX-WS web service.
Create a Java Web project.
Right-click the project and choose New > Web Service or New > Web Service from WSDL.
Complete the wizard. If you don't understand the UI, click Help.
See .
Create a RESTful (JAX-RS/Jersey) web service.
Create a Java Web project.
Right-click the project and choose New > RESTful Web Service from Database or RESTful Web Service from Patterns. If you have an existing project with database entity classes, you can use the RESTful Web Service from Entities wizard, but only if you created JAXB annotations for the entity classes.
See .
Create a JAX-WS Service Client
Create a Java Web or Java project.
Right-click the project and select New > Web Service Client (or New > Other > Web Services > Web Service Client). A wizard opens in which you point to a local project or the URL of a remote WSDL. After completing the wizard, your project has a Web Service References node.
Expand the project's Web Service References node.
Drag and drop the web service operation you want from the Web Services Node into your code, depending on the type of client you want to implement:
In a plain Java project, drag it into the main class.
In a Java Web application, either drag the operation into the JSP file...
...or add a servlet to the Java Web application and drag the operation into the servlet.
Write your implementation code.
See .
Create a Java client for a RESTful web service
Create a Java, Java Web, or NetBeans Module project.
Right-click the project node and select New > Other > Web Services > RESTful Java Client. A wizard opens.
Complete the wizard. You can choose either a RESTful service in a local NetBeans project or you can choose a service that is registered in the IDE.
You can register a remote web service with the IDE provided you have the URL of the service's WADL or WSDL file. Open the Services window, right-click the Web Services node and choose Add Web Service.
Code the graphical client, for example in Swing (for a Java application) or in a JSP/JSF file (for a Java Web application).
Use the Run tab in the Project Properties dialog box to change the server.
Test a web service.
To test a JAX-WS service, go to the Projects window, right-click the web service's node,
and select Test Web Service. You must be able to deploy the service to a running target server.
To test a RESTful web service, go to the Projects window, right-click the project's
node, and select Test RESTful Web Services. You must be able to deploy the service to a running target server. A browser
window opens in which you can test different HTTP methods against the web service's nodes.
Debug a project.
Right-click any project and choose Debug.
Attach source code to libraries for debugging.
Instead of debugging the source code of a library that you created in the IDE,
debug the project where
you created the library.
But, if you want to debug a library created outside the IDE, do the following:
Choose Tools > Library
Manager from the main window.
If the JAR file is not already registered in the Ant Library Manager,
create a new library using the Add Library button.
Select the library in the left panel of the Ant Library Manager.
In the Classpath tab, click Add JAR/Folder and specify the location
of the JAR file containing the compiled class files. A library can contain
multiple JAR files.
In the Sources tab, add the
folder or archive file containing the source code.
Add Javadoc to a project.
Choose Tools > Library
Manager from the main window.
If the JAR file is not already registered in the Ant Library Manager,
register the JAR file as described above.
In the Javadoc tab, click
Add ZIP/Folder and specify the location of the Javadoc files.