We are moving to era of annotation, how simple it could be to just have an annotation to indicate some thing as web service and at right click of the class you have option to deploy it and test it.
Example:
Class IntegerMaths {
Integer add(Integer operand1, Integer operand2){
return operand1+operand2;
}
above is just a service class, I would call it as service class as it provides services to the some one else..
If I would like above class to expose as web service I would expect it to work if just modify it to .
@RegisterID = santosh.maths.IntegerMaths -- Not necessary to be a package path. Just needs to be unique id to indentify the class.
Class IntegerMaths {
@WebSerivce
Integer add(Integer operand1, Integer operand2){
return operand1+operand2;
}
Once I am done with this, I just need to have right click on the class to deploy it to server, and option to have quick test on it..
Above one could be made as UI based also i.e Once you right click on a POJO class, you will get option publish as web service, you have the UI to enter
1. Server where this service needs to be hosted.
2. Unique ID within registry where the service as hosted.
No comments:
Post a Comment