LibraryLink ToToggle FramesPrintFeedback

JAX-RS Service Development

This sample includes a basic REST-based web service developed using JAX-RS (JSR-311). The client code in this sample demonstrates how to send HTTP GET/POST/PUT/DELETE requests. The server code demonstrates how to build a RESTful endpoint through JAX-RS (JSR-311) APIs.

The following events occur on the client and server when you run this sample:

These instructions use Maven to build and run the sample. If you prefer to use wsdl2java, javac, and java to build and run the sample, see the ReadMe file located in your install_dir\samples\jax_rs\basic\ directory.

See About Maven and Installing and setting up Maven for more information about using Maven with the FUSE Services Framework samples.

The pom.xml file located in the base directory of this sample is used to build and run the demo.

To build and run the sample:

The messages between the client and server appear rapidly in the consoles as messages are exchanged. When the messages have all been sent, you can examine the output in the client and server consoles to observe the following events:

When you run the Maven mvn install command, Maven compiles the Java files and creates Java class files. Maven creates the install_dir\\samples\jax_rs\basic\target directory, which includes the client and server class files.

When you run the Maven mvn -Pserver and mvn -Pclient commands, Maven starts the server and client and executes the operations in the Java class files.

The sample files in the jax_rs\basic directory include the following: