I use a pure spring configuration, but this is because Im using spring 2, so
take this with a grain of salt if you are using a previous version of spring
(probably would still work though). If you don't use services.xml and just
define
<bean id="serviceFactory"
class="org.codehaus.xfire.annotations.AnnotationServiceFactory">
<constructor-arg index="0">
<bean
class="org.codehaus.xfire.annotations.jsr181.Jsr181WebAnnotations"/>
</constructor-arg>
<constructor-arg index="1" ref="xfire.transportManager"/>
<constructor-arg index="2">
<bean class="org.codehaus.xfire.aegis.AegisBindingProvider">
<!--vvv this depends on what oxm binding style you are
using vvvv-->
<constructor-arg index="0">
<bean class="org.codehaus.xfire.jaxb2.JaxbTypeRegistry"/>
</constructor-arg>
</bean>
</constructor-arg>
</bean>
<bean id="myServiceBean"
class="com.example.my.service.impl.MyService"/>
<bean id="myHandler1"
class="com.example.my.handler.CustomHandler1"/>
<bean id="myHandler2"
class="com.example.my.handler.CustomHandler2"/>
<bean id="myService" class="org.codehaus.xfire.spring.ServiceBean">
<!-- Only need to specify these if you didn't specify them in the
annotation
<property name="name" value="MyServiceName"/>
<property name="namespace" value="http://myexample/namespace"/>
-->
<property name="serviceBean" ref="myServiceBean"/>
<property name="serviceFactory" ref="serviceFactory"/>
<property name="inHandlers">
<list>
<ref bean="loggingHandler"/>
<ref bean="domInHandler"/>
<ref bean="securityInHandler"/>
<ref bean="authenticationHandler"/>
<ref bean="myHandler1"/>
<ref bean="myHandler2"/>
</list>
</property>
<property name="outHandlers">
<list>
<ref bean="domOutHandler"/>
<ref bean="loggingHandler"/>
</list>
</property>
</bean>
This allows you to declare handlers as beans and reuse them in the various
services you choose to.
Thatcher
-----Original Message-----
From: Tomek Sztelak [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 02, 2006 5:09 AM
To: [email protected]
Subject: Re: [xfire-user] Add In/Out handlers to Jsr181 service via Spring
config?
I'll try to add such functionality this weekend ( adding handlers via custom
annotations ), but you can remind me about it, case i'm a little busy lately
:)
On 11/1/06, Tomek Sztelak <[EMAIL PROTECTED]> wrote:
> It should be possible using spring postprocessor beans.
>
> On 11/1/06, John Woolf <[EMAIL PROTECTED]> wrote:
> > Hi All,
> >
> > I have several Jsr181 services configured via Spring - ie,
> > xfire-servlet.xml instead of services.xml. They work great.
> >
> > What I'm trying to do is add specific handlers to a subset of these
> > services. What I'd like to do is declare them via my Spring config.
> > Does anybody have experience with this or any advice on how to
> > proceed? Is there a way to combine service definitions from
> > services.xml and another config file - for example, use the existing
> > syntax to define handlers for my spring-config'd Jsr181 services in
> > services.xml?
> >
> > Note: using services.xml to define global handlers for my services
> > won't work because we require that different handlers are applied to
> > different services - some services having no additional handlers at
> > all.
> >
> > I suppose I could try to add the handlers programmatically on
> > startup, but that seems hackish.
> >
> > Thanks in advance...
> >
> > -John
> >
> > --------------------------------------------------------------------
> > -
> > To unsubscribe from this list please visit:
> >
> > http://xircles.codehaus.org/manage_email
> >
> >
>
>
> --
> -----
> When one of our products stops working, we'll blame another vendor
> within 24 hours.
>
--
-----
When one of our products stops working, we'll blame another vendor within 24
hours.
---------------------------------------------------------------------
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