Ah, got it. Context doesn't exist in the object's contructor, but does when the method is called. So I could just lazily configure it.

Next question : can I point that property to eg a spring PropertyPlaceholderConfigurer, so my config information remains distinct from the service definition?

cheers,
clive

----- Original Message ----- From: "Hogan, Gavin" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, June 04, 2007 8:47 PM
Subject: RE: [xfire-user] Service class configuration



You could add the Context into your service method ....


public MyResponseObject saveCourse(MyRequestRequestObject req,
MessageContext ctx) {
String ds = ctx.getContextualProperty("YOUR_KEY");

.....
}

This might not be possible in all cases (Can you change the method?).
If you change your method signature in this fashion Xfire will
automatically create the context for you.



___________________________________________

Gavin Hogan
Programmer/Analyst
The State University of New York
State University Plaza
Albany, NY 12246
Phone 518-443-5481
fax 518-443-5809
e-mail [EMAIL PROTECTED]

-----Original Message-----
From: Clive George [mailto:[EMAIL PROTECTED]
Sent: Monday, June 04, 2007 3:40 PM
To: [email protected]
Subject: Re: [xfire-user] Service class configuration


Thanks for that. Unfortunately AbstractInvoker.getContext() returns null
-
do I need to set something else up?

(earlier post?)

cheers,
clive

----- Original Message ----- From: "Hogan, Gavin" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, June 04, 2007 8:11 PM
Subject: RE: [xfire-user] Service class configuration


From Earlier Post.....


MessageContext ctx = AbstractInvoker.getContext();
ctx.getContextualProperty("YOUR_KEY");


<service>
  ... define your normal attributes ...
  <properties>
    <property key="YOUR_KEY">datasourceinfo</property>
  <properties>
 </service>




___________________________________________

Gavin Hogan
Programmer/Analyst
The State University of New York
State University Plaza
Albany, NY 12246
Phone 518-443-5481
fax 518-443-5809
e-mail [EMAIL PROTECTED]

-----Original Message-----
From: Clive George [mailto:[EMAIL PROTECTED]
Sent: Monday, June 04, 2007 3:02 PM
To: [email protected]
Subject: Re: [xfire-user] Service class configuration



Hi -

Probably a mind-numbingly simple question, but I can't work it out..

I've got my simple xfire (1.2.6) service working - a service with
name, serviceClass and implementationClass specified in services.xml.

I'd now like to configure that service a bit - eg specify database
information, etc. Now I could make the implementationClass query that
from somewhere, but I know it should be possible to do this via some
IoC mechanism, which given xfire uses Spring, I'm guessing is
preferred.

I've seen Spring examples of how to do this, but am wondering if I can

configure this somehow via the services.xml. Or do I have to not use
services.xml, and instead configure xfire a bit more explicitly via
Spring?

(or indeed am I asking entirely the wrong question?)

Hi -

Anybody got any ideas at all about this? I'm guessing by the lack of
response that I may be starting in the wrong place : anybody got any
ideas where I should be starting?

I like the idea of making SOAP type web services out of POJOs, which is
what XFire appears to do. But any web service which actually does
something will require a certain amount of configuration, and dependency
injection seems an appropriate way to do this. Unfortunately I don't
really know where to start here - I can see how to get the POJO, but I
can't see how to tell it stuff to use which isn't part of the SOAP
interface (whether it be simple properties or a configuration class).
Any clues would be much appreciated - or do I just go back to
singletons?

cheers,
clive



______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________

---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email


---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email


--
This email has been verified as Virus free
Virus Protection and more available at http://www.plus.net



______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________

---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email


---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email


--
This email has been verified as Virus free
Virus Protection and more available at http://www.plus.net



______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email ______________________________________________________________________

---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email

Reply via email to