3. Web Service

This chapter provides the information needed to develop web services using the Nablarch application framework.

Nablarch provides the following two frameworks for RESTful web services.

Reason

In RESTful Web Service, a web service can be easily built using some annotations defined in JSR 339(external site, English) .

On the other hand, HTTP Messaging cannot be flexibly designed and implemented because of the following restrictions on the body, HTTP headers and exception control.

  • Control area for Nablarch is required in the HTTP header and body.

    When building a web service that works with an already built external system, the difficulty of design and implementation is high.

  • Customizing the items in the response header is not easy.

    As described in Value set in the response header, the handler has to be replaced to change the response header.

  • Depends on the General Data Format function.

    The development cost increases as a format definition file needs to be created.It is also not easy to customize. The input and output data have to be handled with a Map object, which can easily cause implementation errors.

  • Detailed exception handling is not possible as all exceptions when parsing a request body are mapped to a single exception class.

    Because all exceptions in parsing are thrown as MessagingException, detailed process control based on the root cause cannot be performed.

Tip

Refer to Function Comparison of JAX-RS Support /JSR339/HTTP Messaging for differences between the functions provided by RESTful Web Service and HTTP Messaging.