Announcement Announcement Module
No announcement yet.
How to create Spring managed WS bean WITHOUT SpringWS in Websphere 7? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to create Spring managed WS bean WITHOUT SpringWS in Websphere 7?


    I have a mandate to create a webservice for Websphere 7 that does not use SpringWS. Rather, they are relying on the libraries that ship with WAS to manage the webservice.

    I am using a @javax.jws.WebService annotation to define the bean as a webservice. However, I am not sure if/how to configure it in web.xml or my applicationContext.xml such that I can use it as a spring managed bean and leverage Spring's dependency injections.

    I checked out SimpleJaxWsServiceExporter class, but it seems to require a baseAddress to configure the WS, which in my case, would be handled at the WAS configuration level and not from within Spring.

    Am I misunderstanding how to properly accomplish this? Can anyone point me in the right direction please?



  • #2
    After hours of searching, I somehow kept skipping the part in the documentation that explained everything very simply.

    19.5.5 Exposing servlet-based web services using JAX-WS

    Spring provides a convenient base class for JAX-WS servlet endpoint implementations - SpringBeanAutowiringSupport. To expose our AccountService we extend Spring's SpringBeanAutowiringSupport class and implement our business logic here, usually delegating the call to the business layer. We'll simply use Spring 2.5's @Autowired annotation for expressing such dependencies on Spring-managed beans.
    I added in the extends SpringBeanAutowiringSupport as described in the docs and everything works as expected.

    Hopefully this post may help other individuals if they encounter the same problem(s).