This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler on-line!
See this thread for details.
The moose likes Web Services and the fly likes JAX-WS dependency injection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "JAX-WS dependency injection" Watch "JAX-WS dependency injection" New topic

JAX-WS dependency injection

arief hidayat
Ranch Hand

Joined: Apr 13, 2007
Posts: 33

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

Peer Reynders

Joined: Aug 19, 2005
Posts: 2932
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).
Consider Paul's rocket mass heater.
subject: JAX-WS dependency injection
It's not a secret anymore!