Using filters

In this there is not any information about the language neither
"from" nor "to" but we can infer both of them and convert this link to:

http://services.anotes.org/translator/translate/en/es/task

To infer the "from" language we can use the detectLanguage method of MicrosoftTranslator using the text to translate as parameter
To infer the "to" language we can use the language sent in the request header.

To convert the url before calling the TranslatorRest we must use a filter. For this case we will implement ContainerRequestFilter as show below

Exception Handler

We will use spring-aop; specifically we will use the following aspect
in order to intercept all calls to public methods of the *PTImpl class;
and in case of exception we will generate an object of TranslateResponse setting the result code and the error message

2
comments:

Awesome Work ! Thanks a ton :DI have lots of confusion as there are many different library/implementations are provided by different vendors for developing the webServices. like implementation provided by SUN (metro, Jersey) and by apache (axis 1, soap, axis 2, cxf). I am new to web services so could you provide some guidelines how do I start with to learn about it. Thanks