Hi,

i finally got XFire to do what I want ;)
I created my Invoker taking the service name as constructor param.
The tricky part was to find out how to specify the parameter for the
Invoker in the services.xml file. (I couldn't find any documentation on this :/ )
 <service>
   <name>UserService</name>
<namespace>http://localhost:8080/content/services/UserService</namespace>
   <serviceClass>some.package.api.UserService</serviceClass>
   <invoker>#myInvoker</invoker>
</service>

<bean name="myInvoker" class="some.package.MyInvoker">
   <constructor-arg *value="remoteUserService"*/>
</bean>

Thx!
-mathias


Bernd Schuller schrieb:
Hi Mathias,

the simplest seems to be to specify your own invoker

<service>
 <name>UserService</name>
 ...
 <invoker>...</invoker>
 ...


In your invoker (which extends AbstractInvoker)
you can override getServiceObject():

public Object getServiceObject(final MessageContext context)
  throws XFireFault{

Service service=context.getService();
String name=service.getSimpleName();

Object myServiceObject=...
return myServiceObject;
}

Hope this works for you :)

Best regards,
Bernd.

Mathias Scharl wrote:

I want to export several webservices from my application framework.
when I define a services.xml file and provide the implementing service class
XFire creates a new instance of this class.
e.g.
 <service>
   <name>UserService</name>
<namespace>http://localhost:8080/content/services/UserService</namespace>
   <serviceClass>some.package.api.UserService</serviceClass>
<implementationClass>some.package.impl.UserServiceImpl</implementationClass>
</service>

What I want is to specify my personal "factory" which takes the services name as a parameter, does the lookup in my framework and returns the instance of the already initalized service.

How do I integrate this "factory" in the services.xml file? Do I need to specify an Invoker,
and how can I pass him a serviceName as a paramter?



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

   http://xircles.codehaus.org/manage_email

Reply via email to