Announcement Announcement Module
No announcement yet.
Problem invoking JAXWS web service Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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"
    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.

  • #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.