Please explain me along with the envt which i have to install. A sample program to add 2 numbers would do.
That example is probably part of every single SOAP stack's tutorial/user guide. (I know it is for Axis2.) So you could just download Axis2 and work through its user guide; all sample code you need are part of the Axis2 distribution.
It really goes beyond what a forum like this can do, to ask for complete step-by-step instructions when those are so readily available for all major SOAP implementations.
Ping & DNS - updated with new look and Ping home screen widget
Here http://netbeans.org/kb/docs/websvc/jax-ws.html you have a complete tutorial, including a web service and, among other things, two different JavaEE clients.
If you download NetBeans, then you'll get everything; development environment, application server (GlassFish) with a web service stack built in. Absolutely no need to think!
P.S. I assume you use J2EE in a way that does not imply that you have to use a Java version earlier than 5.