Forum Home » Fuse Distributions » Fuse Services Framework

Thread: Using tags <beans:import.. and <ref bean... inside <jaxws:inInterceptors

 
This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 2 - Last Post: Feb 1, 2012 9:26 AM Last Post By: aknapik
aknapik

Posts: 2
Registered: 01/31/12
Using tags <beans:import.. and <ref bean... inside <jaxws:inInterceptors
Posted: Jan 31, 2012 10:30 AM
 
  Click to reply to this thread Reply
How Can I properly define references to beans inside "jaxws:inInterceptors", which will be referencing beans defined inside "basicConfig.xml" outside "jbossws-cxf.xml" ?
Is it possible or do I have to use only <bean id="" class""/> inside "jbossws-cxf.xml"?

I want to define some beans outside "jbossws-cxf.xml" file for example in "basicConfig.xml" in the same directory.

basicConfig.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns='http://www.springframework.org/schema/beans'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:beans='http://www.springframework.org/schema/beans'
xmlns:jaxws='http://cxf.apache.org/jaxws' xmlns:http='http://cxf.apache.org/transports/http/configuration'
xmlns:security='http://cxf.apache.org/configuration/security'
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://cxf.apache.org/core
http://cxf.apache.org/schemas/core.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd">
<!-- Interceptor autentykacji http -->
<bean id="AuthenticationInterceptor"
class="pl.project.loader.util.interceptor.AutenticateServiceInterceptor" />
</beans>

jboss-cxf.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns='http://www.springframework.org/schema/beans'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:beans='http://www.springframework.org/schema/beans'
xmlns:jaxws='http://cxf.apache.org/jaxws' xmlns:http='http://cxf.apache.org/transports/http/configuration'
xmlns:security='http://cxf.apache.org/configuration/security'
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://cxf.apache.org/core
http://cxf.apache.org/schemas/core.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd">

<beans:import resource="basicConfig.xml" />
<jaxws:server id='PodmiotService' address='http://localhost:8080/project/po'>
<!-- Implementor -->
<jaxws:serviceBean>
<bean class="pl.project.ws.PodmiotService" />
</jaxws:serviceBean>
<!-- Interceptory -->
<jaxws:inInterceptors>
<!-- Interceptor autentykacji http -->
<ref bean="AuthenticationInterceptor" />
.........................

Such configuration can be build itself and deployed withaout problems, but when I try to use defined interceptors I get info as if no interceptor is defined.

njiang

Posts: 572
Registered: 09/17/07
Re: Using tags <beans:import.. and <ref bean... inside <jaxws:inInterceptors
Posted: Feb 1, 2012 3:52 AM   in response to: aknapik in response to: aknapik
 
  Click to reply to this thread Reply
I just did a quick test of it, it works on my camel-cxf unit test code.
So I doubt if you are using some kind of jboss customized version of CXF.

If you are in that case, I'm afraid I cannot help you more.

Willem
aknapik

Posts: 2
Registered: 01/31/12
Re: Using tags <beans:import.. and <ref bean... inside <jaxws:inInterceptors
Posted: Feb 1, 2012 9:12 AM   in response to: aknapik in response to: aknapik
 
  Click to reply to this thread Reply
I know already the answer to my problem. Simple solution is to change import path like this:
<beans:import resource="classpath:META-INF/basicConfig.xml"/>

Edited by: aknapik on Feb 1, 2012 9:13 AM

Edited by: aknapik on Feb 1, 2012 9:26 AM