JAX-WS Webservice in GUICE 3.0 framework

321 views
Skip to first unread message

Santosh

unread,
Jun 8, 2012, 1:51:50 AM6/8/12
to google-guice
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

dim5b

unread,
Aug 12, 2013, 7:08:31 AM8/12/13
to google...@googlegroups.com
Did you fin a solution /example implementation to your problem facing the same problem

Thanks
Dimitri

pe...@peterphi.com

unread,
Aug 29, 2013, 5:05:48 PM8/29/13
to google...@googlegroups.com
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

Santosh Kumar

unread,
Sep 3, 2013, 5:50:26 AM9/3/13
to google...@googlegroups.com
I have used a singleton EJB. First time when Guice constructs the injector, give the reference to an EJB. 
Later on always access EJB to get Injector reference. 


--
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 google-guice...@googlegroups.com.

To post to this group, send email to google...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Santosh Kumar.K.S
Reply all
Reply to author
Forward
0 new messages