Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It seems you are doing things by "hand". I would recommend you0 give a try to <strong><a href="http://cxf.apache.org/" rel="noreferrer">Apache CXF</a></strong>.</p> <p>It's a neat implementation the <strong>JAX-RS API</strong> that enables you to almost forget about REST. It plays well with (also recommended) <strong>Spring</strong>.</p> <p>You simply write classes that implement your interfaces (API). What you need to do is to annotate the methods and parameters of your interfaces with JAX-RS annotations.</p> <p>Then, CXF does the magic.</p> <p>You throw normal Exceptions in your java code, and then use exception mapper on server/nd or client to translate between them and HTTP Status code.</p> <p>This way, on server/Java client side, you only deal with regular 100% Java exception, and CXF handles the HTTP for you: You have both the benefits of a clear REST API and a Java Client ready to be used by your users.</p> <p>The client can either be generated from your WDSL, or built at runtime from introspection of the interface annotations.</p> <p>See :</p> <ol> <li><a href="http://cxf.apache.org/docs/jax-rs-basics.html#JAX-RSBasics-Exceptionhandling" rel="noreferrer">http://cxf.apache.org/docs/jax-rs-basics.html#JAX-RSBasics-Exceptionhandling</a></li> <li><a href="http://cxf.apache.org/docs/how-do-i-develop-a-client.html" rel="noreferrer">http://cxf.apache.org/docs/how-do-i-develop-a-client.html</a></li> </ol> <p>In our application, we have defined and mapped a set of error codes and their counterpart Exceptions :</p> <ul> <li>4XX Expected / Functional excecption (like bad arguments, empty sets, etc)</li> <li>5XX Unexpected / Unrecovable RunTimeException for internal errors that "should not happen"</li> </ul> <p>It follows both REST and Java standards.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload