I've done this by implementing a JAX-RS Application instance that 
constructs the guice services (although I choose to opt out of the JAX-RS 
framework constructing any of the services which may not be what you want). 
I've just open sourced (although it requires work, particularly 
documentation to show how it's used) this based on extensions I made at my 
former employer - if you want to have a look it's 
at 
https://github.com/MediasmithsInternational/stdlib/blob/master/guice/webapp/src/main/java/com/mediasmiths/std/guice/web/rest/jaxrs/GuiceRestApplication.java

The code linked above uses a guice bootstrap class I wrote as part of this 
framework but the approach should be immediately obvious to you - I find 
the JAX-RS interfaces (registered by the guice modules) and create dynamic 
proxies which are passed back the the JAX-RS implementation, these dynamic 
proxies ask the Injector for an instance every time (to allow 
singleton/request/session scoping rules) and then pass on the method 
invocation

On Friday, June 8, 2012 6:51:50 AM UTC+1, Santosh wrote:
>
> We are using GUICE framework as part of service layer. Now there is a 
> requirement on to build JAX-WS Web services. We have built the web 
> services using JDK 1.6 JAX-WS API. But now, we are not able to use any 
> of the GUICE resources as we Web Service is not guice managed. 
>
> We are using Guice 3.0. How do we achieve this? 
>
> Tried the following link http://jax-ws-commons.java.net/guice/, but 
> did not work out and finally got to know that this is compatible only 
> with Guice 2.0 in some forum. 
>
> One more approach tried was 
> http://developian.blogspot.in/2008/11/google-guice-and-jax-ws.html, 
> But this internally will start using some of the sun API which are 
> access restricted and hence I dont want to use... 
>
> Now what is the best approach or alternative any any other solution. 
> Its quite urgent. 
>
> Please advice. 
>
> Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to