Ok, I see the tricks. MultipleEndpointObserver only steps in when there are
more than one endpoint registered on the same address. MultipleEndpointObserver
is the one who initializes the endpoint set. So the config below works:
<bean id="aegisBinding" class="
org.apache.cxf.aegis.databinding.AegisDatabinding"/>
<bean id="versionBean" class="collective.webservices.VersionInterceptor
"/>
<bean id="aegisConfig" class="
org.apache.cxf.aegis.databinding.AegisServiceConfiguration"/>
<bean id="defaultConfig" class="
org.apache.cxf.service.factory.DefaultServiceConfiguration"/>
<bean id="jaxConfig" class="
org.apache.cxf.jaxws.support.JaxWsServiceConfiguration"/>
<bean id="serviceBean" class="
collective.webservices.CollectiveServicesImpl">
<property name="assetFactory" ref="assetFactoryBean"></property>
</bean>
<bean id="assetFactoryBean" class="
collective.webservices.DefaultWSAssetFactory"/>
<jaxws:endpoint id="CollectiveServices" implementor="#serviceBean"
address="/CollectiveServices" >
<jaxws:serviceFactory>
<bean class="
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean">
<property name="dataBinding" ref="aegisBinding"/>
<property name="serviceConfigurations">
<list>
<ref bean="jaxConfig"/>
<ref bean="aegisConfig"/>
<ref bean="defaultConfig"/>
</list>
</property>
</bean>
</jaxws:serviceFactory>
</jaxws:endpoint>
<jaxws:endpoint id="CollectiveServices2" implementor="#serviceBean"
address="/CollectiveServices" >
<jaxws:serviceFactory>
<bean class="
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean">
<property name="dataBinding" ref="aegisBinding"/>
<property name="serviceConfigurations">
<list>
<ref bean="jaxConfig"/>
<ref bean="aegisConfig"/>
<ref bean="defaultConfig"/>
</list>
</property>
</bean>
</jaxws:serviceFactory>
</jaxws:endpoint>
<cxf:bus>
<cxf:inInterceptors>
<ref bean="versionBean"/>
</cxf:inInterceptors>
</cxf:bus>
> -----Original Message-----
> From: Dave Kallstrom [mailto:[EMAIL PROTECTED]
> Sent: 2007?9?19? 3:05
> To: [email protected]
> Subject: Re: Wsdl Versioning
>
>
> And here is my cxf.xml file
>
> <bean id="aegisBinding" class="
> org.apache.cxf.aegis.databinding.AegisDatabinding"/>
>
> <bean id="versionBean"
> class="collective.webservices.VersionInterceptor
> "/>
>
> <bean id="aegisConfig" class="
> org.apache.cxf.aegis.databinding.AegisServiceConfiguration"/>
>
> <bean id="defaultConfig" class="
> org.apache.cxf.service.factory.DefaultServiceConfiguration"/>
>
> <bean id="jaxConfig" class="
> org.apache.cxf.jaxws.support.JaxWsServiceConfiguration"/>
>
> <bean id="serviceBean" class="
> collective.webservices.CollectiveServicesImpl">
> <property name="assetFactory"
> ref="assetFactoryBean"></property>
> </bean>
>
> <bean id="assetFactoryBean" class="
> collective.webservices.DefaultWSAssetFactory"/>
>
> <jaxws:endpoint id="CollectiveServices" implementor="#serviceBean"
> address="/CollectiveServices" >
> <jaxws:serviceFactory>
> <bean class="
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean">
> <property name="dataBinding" ref="aegisBinding"/>
> <property name="serviceConfigurations">
> <list>
> <ref bean="jaxConfig"/>
> <ref bean="aegisConfig"/>
> <ref bean="defaultConfig"/>
> </list>
> </property>
> </bean>
> </jaxws:serviceFactory>
> </jaxws:endpoint>
> <cxf:bus>
> <cxf:inInterceptors>
> <ref bean="versionBean"/>
> </cxf:inInterceptors>
> </cxf:bus>
>
>
> On 9/18/07, Dave Kallstrom <[EMAIL PROTECTED]> wrote:
> >
> > It is most likely my as I am not all that smart.
> > Here is my cxf.xml file and my version interceptor..
> > I know that my interceptor is being called however the
> endpoint set is
> > always null.
> >
> > public class VersionInterceptor extends
> > AbstractEndpointSelectionInterceptor
> > {
> >
> > public VersionInterceptor()
> > {
> > super(Phase.POST_STREAM);
> > addBefore(StaxInInterceptor.class.getName());
> > System.out.println("VersionInterceptor#init()");
> > }
> >
> > @Override
> > protected Endpoint selectEndpoint(Message message,
> Set<Endpoint> eps)
> > {
> > InputStream is = message.getContent(InputStream.class);
> > System.out.println ("Message " + message);
> > System.out.println("EndpointSet " + eps);
> > }
> > }
> >
> > On 9/17/07, Liu, Jervis < [EMAIL PROTECTED]> wrote:
> > >
> > > Hi Dave, Firstly you need to make sure you are using SOAP
> binding, at
> > > the moment only the SOAP binding is using
> MultipleEndpointObserver. Then you
> > > can add your interceptor (that extends from
> > > AbstractEndpointSelectionInterceptor) into the chain using spring
> > > configuration similar to the way how logging interceptor
> is added, see [1].
> > > Please pay attention to the phase of your interceptor,
> your interceptor
> > > needs to be the very first one that being invoked in the
> inbound interceptor
> > > chain. You might see AttachmentInInterceptor is invoked
> before your
> > > interceptor, but that is ok. I believe using Phase.POST_STREAM and
> > > addBefore(StaxInterceptor.class.getName()) should give
> you the right
> > > phase.
> > >
> > >
> > > [1]. http://cwiki.apache.org/CXF20DOC/configuration.html
> > >
> > > Cheers,
> > > Jervis
> > >
> > > > -----Original Message-----
> > > > From: Dave Kallstrom [mailto:[EMAIL PROTECTED]
> > > > Sent: 2007?9?17? 23:58
> > > > To: [email protected]
> > > > Subject: Re: Wsdl Versioning
> > > >
> > > >
> > > > It looks like I might not be able to set this up through
> > > > cxf.xml? I don't
> > > > see a way to get the MultipleEndpointObserver from the
> > > > JaxWsServiceFactoryBean so that I can add a
> routingInterceptor to it.
> > > >
> > > > On 9/15/07, Liu, Jervis <[EMAIL PROTECTED] > wrote:
> > > > >
> > > > > Hi, your interceptor needs to extend from
> > > > > AbstractEndpointSelectionInterceptor. Also make sure you
> > > > have registered
> > > > > your routing interceptor with the MultipleEndpointObserver,
> > > > please refer to
> > > > >
> > > > \trunk\systests\src\test\java\org\apache\cxf\systest\versionin
> > > > g\Server.java
> > > > >
> > > > > Cheers,
> > > > > Jervis
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Dave Kallstrom [mailto:[EMAIL PROTECTED]
> > > > > > Sent: 2007?9?15? 2:39
> > > > > > To: [email protected]
> > > > > > Subject: Re: Wsdl Versioning
> > > > > >
> > > > > >
> > > > > > Thanks for the response. I tried adding an incoming
> > > > > > interceptor that extends
> > > > > > AbstractEndpointInterceptor very similar to the example. The
> > > > > > only problem I
> > > > > > see is
> > > > > > that the incoming set of endpoints to my selectEndpoint
> > > > > > methid is always
> > > > > > null. My no arg constructor is calling
> > > > > > super(Phase.POST_STREAM) and then
> > > > > > addBefore(StaxInterceptor.class.getName())
> > > > > > Am I doing this correctly? Or could it be because I
> only have
> > > > > > one endpoint?
> > > > > >
> > > > > > On 9/14/07, Jean-François Daune <[EMAIL PROTECTED]> wrote:
> > > > > > >
> > > > > > >
> > > > > > > This document is quite interesting about this subject:
> > > > > > >
> > > > > > >
> > > >
> http://blogs.iona.com/sos/20070410-WSDL-Versioning-Best-Practise.pdf
> > > > > > >
> > > > > > > Cheers,
> > > > > > >
> > > > > > > J-F
> > > > > > >
> > > > > > > -----Message d'origine-----
> > > > > > > De : Liu, Jervis [mailto: [EMAIL PROTECTED]
> > > > > > > Envoyé : vendredi 14 septembre 2007 3:55
> > > > > > > À : [email protected]
> > > > > > > Objet : RE: Wsdl Versioning
> > > > > > >
> > > > > > >
> > > > > > > Hi Dave, we've had a very basic versioning implementation.
> > > > > > Basically how
> > > > > > > it works is an interceptor sitting at the beginning of
> > > > > > in-bound interceptor
> > > > > > > chain as a mediator to inspect then dispatch the coming
> > > > > > request to different
> > > > > > > endpoints. An example can be found from a system
> test sample:
> > > > > > >
> > > > > >
> \trunk\systests\src\test\java\org\apache\cxf\systest\versionin
> > > > > > g. Let me know
> > > > > > > if you have any further questions. Willem Jiang is
> > > > > > currently working on
> > > > > > > adding a much more powerful routing support using Apache
> > > > > > Camel, hopefully
> > > > > > > this will provide a better foundation for implementing
> > > > > > versioning in CXF
> > > > > > > once it is done.
> > > > > > >
> > > > > > > Cheers,
> > > > > > > Jervis
> > > > > > >
> > > > > > >
> > > > > > > > -----Original Message-----
> > > > > > > > From: Dave Kallstrom [mailto:[EMAIL PROTECTED]
> > > > > > > > Sent: 2007?9?14? 2:53
> > > > > > > > To: [email protected]
> > > > > > > > Subject: Wsdl Versioning
> > > > > > > >
> > > > > > > >
> > > > > > > > We have recently migrated our web services offering from
> > > > > > > > xfire to cxf and
> > > > > > > > everything is going well. Now the issue is that we have
> > > > > > > > several clients who
> > > > > > > > would like different features and I am
> wondering how best to
> > > > > > > > accomplish
> > > > > > > > this. The changes being requested will likely
> result in a
> > > > > > > > different wsdl so
> > > > > > > > I would like to be able to version our wsdls
> with different
> > > > > > > > namespaces. The
> > > > > > > > question is where do I inspect the wsdl
> namespace and then
> > > > > > > > how do I provide
> > > > > > > > different functionality depending on the
> incoming namespace?
> > > > > > > > I am using
> > > > > > > > aegis bindings and cxf.xml with the cxf servlet.
> > > > > > > > Any ideas would be appreciated.
> > > > > > > >
> > > > > > > > --
> > > > > > > > Dave Kallstrom
> > > > > > > >
> > > > > > >
> > > > > > > ----------------------------
> > > > > > > IONA Technologies PLC (registered in Ireland)
> > > > > > > Registered Number: 171387
> > > > > > > Registered Address: The IONA Building, Shelbourne Road,
> > > > > > Dublin 4, Ireland
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Dave Kallstrom
> > > > > >
> > > > >
> > > > > ----------------------------
> > > > > IONA Technologies PLC (registered in Ireland)
> > > > > Registered Number: 171387
> > > > > Registered Address: The IONA Building, Shelbourne Road,
> > > > Dublin 4, Ireland
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Dave Kallstrom
> > > >
> > >
> > > ----------------------------
> > > IONA Technologies PLC (registered in Ireland)
> > > Registered Number: 171387
> > > Registered Address: The IONA Building, Shelbourne Road, Dublin 4,
> > > Ireland
> > >
> >
> >
> >
> > --
> > Dave Kallstrom
>
>
>
>
> --
> Dave Kallstrom
>
----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland