I am not sure to understand what you mean by encapsulate an application with Web services... Could you explain?
So my guess is, you are asking how you can expose some business logic of your J2EE Application as Web Service.
The implementation, and operation details will depend of the platform you are running on, and the Web Services stakc you are using. You have various Web Services solution in the Java world, for example Oracle provides you on the server side as well on the tooling support for the J2EE standard to build Web Services (JAX-RPC) but you can also you vendor specific API or open source implementation such as Apache Axis.
Most of the platform provide you tools to publish a Java class as Web service -called Bottom-Up approach -. The tool could be a command line utility, an Ant task or integrated inside your IDE.
Also it is interesting to know that in J2EE 1.4, Web Services are now integrated to the platform, and one of the features is the possibility to publish a Stateless Session Bean as Web Service. On the packaging side, generally it is the same as any other J2EE application you can package your application in a WAR/EAR file.
Some pointers to start with Web Services development in Java:
-TSS Articles on J2EE and WS
- The Java Web Services Tutorial (SUN)
- Turn EJB components into Web services
Oracle based demonstrations/tutorials
- Web Services End-To-End Development
- OTN Web Services Center
- Web Services Section
Build and deploy WS using Apache Ant
Hope that helps.