Dynamically assign web service endpoint urls
Our business process invokes an external web service, we may need to change the web service URLs for different environments.
For Example: For DEV server we will have one web service end point URL where as for PROD there will be a different one. So in this case we should be able to set the endpoint urls dynamically depending on the environment so that we do not need to change our EAR file for each environment.How do we assign an end point URL dynamically t开发者_如何学JAVAo a web service in WebSphere Server?
Please help me because i am beginer for WebService.
If you are using Spring (or can use Spring) then I would suggest using PropertyPlaceholderConfigurer. Also please take a look at this post for setting up different deployment environment settings.
Call javax.xml.ws.Service.setHandlerResolver. Pass an implementation that returns an implementation of LogicalHandler. In handleMessage, check MESSAGE_OUTBOUND_PROPERTY to update ENDPOINT_ADDRESS_PROPERTY.
精彩评论