users@jersey.java.net

Re: [Jersey] How to expose (programatically) an instance of a web service?

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 09 Jul 2009 12:11:53 +0200

Hi Igor,

I notice now that there are more responses @ StackOverflow.

Naresh is working on the Jersey test framework to make it easier for
you to do this.

In the interim you may want to look at some source in the jersey-test
module that utilizes Grizzly, for example see the source in the
package "com.sun.jersey.impl.container.grizzly.web".

Paul.

On Jul 4, 2009, at 8:14 PM, Igor Moochnick wrote:

> If I have a definition of a web service, i.e.:
>
> @Path("/srv")
>
> public class MyService
>
> {
>
> @GET
> public void action(@Context UriInfo uri)
>
> { ... }
>
> }
>
>
> How can I expose its instance via Jersey from within my code?
>
> I.e.:
>
> MyService service = new MyService();
>
> service.setSomething(...);
>
>
> // How do I host it?
>
>
>
> Thanks!
>
> I've posted this question on StackOverflow and still don't have an
> answer:
>
> http://stackoverflow.com/questions/911813/what-is-the-best-way-to-write-a-test-case-for-jersey-web-services
>
>
> Regards,
>
> IgorM