Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAX-WS dependency injection

 
arief hidayat
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have generate JAX-WS client ...

Here are the part of the code


The generated code.. hard codes the String value.. such as WSDL location etc.

How could I change it so that we can configure it easily..??
maybe.. using Spring dependency injection or read from property file

thanks
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The annotations only provide default values. They simply make deployment descriptors optional.

As far as I know you should still be able to override the values in the service-ref descriptor of the web.xml for servlet clients and the ejb-jar.xml for EJB clients.

However most modifications to the WSDL will require you to regenerate the client stub anyway. So the only thing about the referenced WSDL that really is configurable is the endpoint URL. And the WSDL referenced is often stored inside the WAR or EAR anyway (i.e. it's a copy of the original WSDL).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic