动态分配Web服务端点URL

时间:2021-07-24 16:50:33

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.

我们的业务流程调用外部Web服务,我们可能需要更改不同环境的Web服务URL。例如:对于DEV服务器,我们将有一个Web服务端点URL,对于PROD,将有一个不同的URL。因此,在这种情况下,我们应该能够根据环境动态设置端点URL,这样我们就不需要为每个环境更改我们的EAR文件。

How do we assign an end point URL dynamically to a web service in WebSphere Server?

我们如何动态地将端点URL分配给WebSphere Server中的Web服务?

Please help me because i am beginer for WebService.

请帮帮我,因为我是WebService的初学者。

2 个解决方案

#1


0  

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.

如果您使用Spring(或可以使用Spring),那么我建议使用PropertyPlaceholderConfigurer。另请查看此帖子以设置不同的部署环境设置。

#2


0  

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.

调用javax.xml.ws.Service.setHandlerResolver。传递一个返回LogicalHandler实现的实现。在handleMessage中,检查MESSAGE_OUTBOUND_PROPERTY以更新ENDPOINT_ADDRESS_PROPERTY。

#1


0  

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.

如果您使用Spring(或可以使用Spring),那么我建议使用PropertyPlaceholderConfigurer。另请查看此帖子以设置不同的部署环境设置。

#2


0  

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.

调用javax.xml.ws.Service.setHandlerResolver。传递一个返回LogicalHandler实现的实现。在handleMessage中,检查MESSAGE_OUTBOUND_PROPERTY以更新ENDPOINT_ADDRESS_PROPERTY。