You have to extend the XFireServlet 
(http://xfire.codehaus.org/Embedding+XFire). Then instantiate whatever objects 
you want as part of the init() method of the servlet. You then register these 
objects as web services, as I have indicated previously...

Mauro Gatti <[EMAIL PROTECTED]> wrote:    P { margin:0px; padding:0px } body { 
FONT-SIZE: 10pt; FONT-FAMILY:Tahoma }   Thanks for the reply. This is exactly 
what I need but....how? This is my first try with Xfire and I have to clear out 
 some things yet.
 
 I'm using Tomcat 5.5 as container and the jaxb2 examples in the Xfire 
distribution as guide. I understand that
 the container use org.codehaus.xfire.transport.http.XFireConfigurableServlet 
as servlet (web.xml) and my service's
 implementation class is specified in META-INF/xfire/services.xml as per the 
examples.
 
 So what I have to implement to override the XFire instantation of the service 
and build it myself? The docs aren't
 very friendly with newbies...
 


---------------------------------
Date: Thu, 21 Jun 2007 06:24:38 -0700
From: [EMAIL PROTECTED]
To: [email protected]
Subject: Re: [xfire-user] Using external properties file

You have to instantiate your service "yourself", and pass that instance to 
XFire (and not let XFire instantiate your service itself). This allows you to 
set whatever  data is necessary on your service:
 
 MyService instance = new MyService()
 
 instance.setXXXX(xxxx)
 instance.setYYYY(yyyy)
 
 // factory is either ObjectServiceFactory, AnnotationFactory...
 Service service = factory.create(class, name,namespace, null);
 
 // This is where it's done:
 service.setInvoker(new BeanInvoker(instance));
 
 This is what I am doing on my side and it works fine.
 
Mauro Gatti <[EMAIL PROTECTED]> wrote: How can I load a set of custom 
properties from an external file? I wrote a web service in a schema-first 
development project using Xfire-1.2.6 and now I have a fully functional 
implementation class for test purpose. In production environment the service 
will rely on a set of parameters that should be dinamically altered to match 
the actual environment so I would like to implement a properties file to be 
loaded at expose time of the web service. Is there a way to use an external 
resource file out of the implementation class? If I load the properties file 
inside the class this would be done every time a single method of the 
implemetation is invoked.

Thanks for any help


---------------------------------
Con Windows Live Messenger chatti, parli, giochi, crei il tuo blog, controlli 
la tua posta, scambi file, foto e molto altro con un solo programma GRATUITO. 
Scarica Messenger 8.1


---------------------------------
2 GB di spazio, protezione da virus e spyware...GRATIS!    Windows Live Hotmail

Reply via email to