Hi,
I hope that I have done sufficient googling for this not to be an FAQ, but I
have a question about configuring a cxf:rsClient with a list of
"serviceClass"es. We tend to have a number of related REST resource
interfaces implemented within a single service (aka Tomcat servlet context).
I have had some success configuring and using a cxf:rsClient to access my
service using a proxy of the first REST resource interface. For example:

        <cxf:rsClient id="myRestService"
                address="${myServerHost}/resource"
                username="${authUsername}" password="${authPassword}"
                loggingFeatureEnabled="true" inheritHeaders="true"
                serviceClass="com.me.FirstResource">
                <cxf:providers>
                        <ref bean="jaxbAccountProvider"/>
                </cxf:providers>
        </cxf:rsClient>

I want to extend this configuration to have multiple resource interfaces,
but the intuitive approach of listing them in the serviceClass attribute
doesn't work.
I get the impression from the Camel component page for cxfrs (although I
haven't validated it) that you can configure an rsServer using a
resourceClasses url query parameter, but that doesn't work for an rsClient
(producer vs consumer, yadda, yadda, yadda)
I don't want to have to repeat myself by defining 3 rsClients with each of
the resource interfaces and re-specify the address and credentials. I want
to be as DRY as possible. Also it means that the routes that use the "same
service" have to know which rsClient bean to use to get the desired
interface.
My latest attempt is using the modelBeans element in a single rsClient to
configure the interfaces for the service, but I think it's intended for
interfaces that do not have the JAX-RS annotations and so I would be
repeating the operations and parameters and everything in the XML
configuration. Does anyone know how to do something like:

        <cxf:rsClient id="myRestService"
                address="${myServerHost}/resource"
                username="${authUsername}" password="${authPassword}"
                loggingFeatureEnabled="true" inheritHeaders="true" >
                <cxf:providers>
                        <ref bean="jaxbAccountProvider"/>
                </cxf:providers>
                <cxf:modelBeans>
                        <util:list>
                                <bean class="com.me.FirstResource"/>
                                <bean class="com.me.SecondResource"/>
                                <bean class="com.me.ThirdResource"/>
                        </util:list>
                </cxf:modelBeans>
        </cxf:rsClient>

Currently Spring complains about using the class attribute for the
FirstResource, etc, but they are interfaces. (Please don't push me down the
Spring AOP route.)
Am I being unreasonable?

Thanks for any help,

Nick.




--
View this message in context: 
http://camel.465427.n5.nabble.com/cxfrs-proxy-base-rsClient-with-multiple-resource-interfaces-tp5766253.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to