I want to create and deploy a web service to OSGi container. For example, publish the service to the address:
http://localhost:8080/testservice.
To answer your question, since Karaf (FUSE ESB) uses Pax Web as it's default Web-Container take a look at Pax Web for more details how it works and probably best for you at the more than 100 integration tests of Pax Web to give you an Idea on how to use it. There are also samples available to show you how to use either std. Http-Service, through Whiteboard-Extender or as WAR/WAB.