JAXWS - 如何更改端点地址 [英] JAXWS — how to change the endpoint address

查看:244
本文介绍了JAXWS - 如何更改端点地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何动态更改JAXWS客户端使用的地址?
此客户端由wsimport生成。

How can I dynamically change the address which my JAXWS client is using? This client was generated by wsimport.

推荐答案

使用Apache CXF解决了问题。

Solved the problem using Apache CXF.

只需两行代码!以下是摘录:

With just two lines of code! Here is the snippet:

URL url_wsdl = new URL("http://myserver/myservice?wsdl");
Service service = Service.create(url_wsdl, new QName("http://myaddress...", "ServiceName"));
return service.getPort(MyJAXWSPortClass.class);

这篇关于JAXWS - 如何更改端点地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆