-
Jul 11th, 2012, 01:41 PM
#1
Problem invoking JAXWS web service
I have several web services implemented using Apache CXF framework. On the client side, I have defined the beans like:
<jaxws:client id="deviceWSClient"
serviceClass="..IDeviceWebService"
address="http://localhost:8080/../DeviceWS" />
If I do:
ApplicationContext context = new ClasspathXmlApplicationContext(spring-config.xml);
IDeviceWebService deviceWebService = context.getBean("deviceWSClient");
it works perfectly fine.
The problem is when I try to inject this bean in the Controller using @Autowired (I'm using MVC pattern). In this case it looks like it works, but If I get the traffic trace I don't get any HTTP request between the client side and the web service (using ApplicationContext I get the HTTP request). I've tried using @WebServiceRef annotation instead, and it's the same behaviour. I guess it works because it gets the dependency from the local repository and uses it as a library.
Could anyone tell how I should do it better? I'm using Spring 3.0.6 RELEASE.
Thank you very much.
-
Jul 14th, 2012, 11:28 AM
#2
Forget this question. I was trying to use @Autowire, but I wasn't naming the variable properly to be able to bind with the bean defined in the spring-conf.xml file.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules