Hi Sagara,
Yes, I found your blog post very useful indeed, as mentioned below. Thanks!
Did you ever have any thoughts about the particular problem I describe
- how to configure axis2 to use Guice in jsr181 annotations, without
using a services.xml file?
Bruce.
Quoting Sagara Gunathunga <[email protected]>:
Hope this [1] also help out.
[1] - http://ssagara.blogspot.com/2009/05/guice-axis2-integration.html
Thanks,
On Mon, Apr 26, 2010 at 9:19 AM, <[email protected]> wrote:
Hi Martin,
Guice code came from maven central, but should be the same as your link,
yes.
org.apache.axis2.ServiceObjectSupplier is in axis2-1.5.1.jar, so from
http://ws.apache.org/axis2/download/1_5/download.cgi
My implementation of ServiceObjectSupplier is GuiceServiceObjectSupplier
(attached). We also need a web.xml and some glue classes for the
guice/servlet integration (attached). This approach is very similar to that
at http://ssagara.blogspot.com/2009/05/guice-axis2-integration.html .
Finally, we add <parameter name="ServiceClass"
locked="false">com.example.Api</parameter>
<parameter name="ServiceObjectSupplier"
locked="false">com.example.guiceintegration.GuiceServiceObjectSupplier</parameter>
to the services.xml (as per
http://ws.apache.org/axis2/1_5_1/axis2config.html#Service_Configuration)
Our service class com.example.Api can now use google injections.
So, my question is: In the case when I use jsr181 annotations, and deploy
my annotated pojo, as at
http://ws.apache.org/axis2/1_5_1/pojoguide.html#jsr181pojows I don't have
a services.xml. How then can I tell axis2 to use my
GuiceServiceObjectSupplier?
Hope you can now track what I'm trying to do - let me know if I've missed
any details.
Cheers,
Bruce.
Quoting Martin Gainty <[email protected]>:
Hi Bruce
experiencing difficulty tracking your guice injection effort
did you get your Guice code here?
http://code.google.com/p/google-guice/downloads/list
can you provide the link for the jars or source which contain
ServiceObjectSupplier?
thanks!
Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
dient lediglich dem Austausch von Informationen und entfaltet keine
rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
destinataire prévu, nous te demandons avec bonté que pour satisfaire
informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
de ceci est interdite. Ce message sert à l'information seulement et n'aura
pas n'importe quel effet légalement obligatoire. Étant donné que les email
peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
aucune responsabilité pour le contenu fourni.
Date: Sun, 25 Apr 2010 23:46:08 +0100
From: [email protected]
To: [email protected]
Subject: [Axis2] JSR181 and ServiceObjectSupplier
Hi,
I'm using axis2-1.5.1. What is the JSR181 equivalent of the parameter
"ServiceObjectSupplier" in services.xml? Is it sensible to write a
custom POJODeployer?
I'm trying to integrate Google Guice and Axis2 using JSR181 annotated
POJOs to define my web service.
a) I can make Guice inject dependencies into my services by adding the
parameter
<parameter name="ServiceObjectSupplier" locked="false">
com.example.guiceintegration.GuiceServiceObjectSupplier
</parameter>
to my services.xml, where
com.example.guiceintegration.GuiceServiceObjectSupplier is an
implementation of org.apache.axis2.ServiceObjectSupplier which supplies
instances of the service object obtained from the Guice injector.
b) I can deploy JSR181 annotated POJOs by putting the .class in the
directory specified in <deployer extension=".class" directory="pojo"
class="org.apache.axis2.deployment.POJODeployer"/> in my axis2.xml
What is the best way to combine a) and b)?
Either
1) Is there an annotation which does the job of the
ServiceObjectSupplier parameter? I would like something like
@WebService(name="foo",
serviceobjectsupplier=GuiceServiceObjectSupplier.class).
or
2) Can I achieve the effect I want by writing a custom POJODeployer?
I'm not very familiar with the axis2 codebase - is there a hook for
creating service objects?
might be good approaches.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
_________________________________________________________________
Hotmail is redefining busy with tools for the New Busy. Get more from your
inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
--
Sagara Gunathunga
Blog - http://ssagara.blogspot.com
Web - http://people.apache.org/~sagara/
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]