I want to create and deploy a web service to OSGi container. For example, publish the service to the address:
http://localhost:8080/testservice.
You may find the following tutorial helpful: http://www.javabeat.net/2011/11/writing-an-osgi-web-application/. It's based on chapter two of Enterprise OSGi in Action. Chapter eight also has a discussion of how to use build tools like maven to get the right bundle structure, and http://coding.alasdair.info/2011/01/creating-web-application-bundle-using.html also has really helpful maven instructions.
At a high level, your best route is probably to take advantage of something like Apache Aries or Eclipse Gemini to allow you to run a WAB (a web bundle). A WAB is structured almost exactly like a WAR, except that the manifest has OSGi metadata in it. Your servlet class itself would be identical to the non-OSGi case. The framework will handle discovering and launching your servlet.