JAX-WS web services are more powerful than JAX-RPC web services.JAX-WS web services have well defined security machanisum.In case of JAX-RPC web services the developer has to take care security aspects.
As we know Java EE 5 supports Anotations.Form Java EE 5 onwards we can use Annotations to define a web service.It is possible to define a web services in side its binding class itself.If we are using lower J2EE version than Java EE 5 we need to use WSDL as a separate XML document with wsdl as file extension.
In the bellow code sample I used Annotations to define my web service.Ofcorse I have also created WSDL for each of my Web Services.I used JAX-WS type web serviec.For the sake of simplicity i did' t use any security features.This web service performs credit history check up and generates credit score.
Important Point: My main intentions with this code sample is to explain how to use JAX-WS web service.So I am not going actual datails of how credit history is checked and credit score is evaluated like stuff.To put more light on technical aspects I used Random number generator to generate credit scores.