jax-ws 生成的 Web 服务客户端在运行时更改服务端点
如何更改由 netbeans 向导生成的 Web 服务客户端的 Web 服务端点 URL(来自 wdsl URL 的 Web 服务客户端)。
我尝试通过此问题中给出的两种方法更改Web服务端点 更改 WebService 端点地址在运行时。
不知何故,这两种方法都不适用于我的情况。即使我提供的 URL 中包含不存在的或空的主机名,Web 服务端点也保持不变。它仍然引用我在netbeans中的glassfish服务器上运行的测试web服务,并成功从web服务加载数据。
我尝试清理并重建所有涉及的代码以确保其中没有错误。我尝试使用调试器来确保 Web 服务的端点 URL 已更改,但我似乎无法找到该变量在服务或端口类中的位置。
谁知道出了什么问题?
How can I change the webservice endpoint URL of a webservice client generated by the netbeans wizard (webservice client from wdsl URL ).
I tried to change the webservice endpoint by both methods given in this question Change WebService endpoint address at run time .
Somehow both methods don't work in my situation. The webservice endpoint stays the same even if I give an URL with a non existing or empty host name in it. It still refers to my testing webservice running on the glassfish server in netbeans, and succesfully loads data from the webservice.
I tried to clean and rebuild all the involved code to make sure that there is no mistake there. I tried to use the debugger to make sure that the endpoint URL is changed for the webservice, but I can't seem to find where this variable is located in service or port class.
Who has an idea of what is going wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
上述问题中给出的解决方案之一现在对我有用。我不知道我做了什么改变才能使这项工作成功。
One of the solutions given in the mentioned question is now working for me. I don't know what I changed to make this work.
检查您提供的
ENDPOINT_ADDRESS_PROPERTY
是否正确,而不是 WSDL URL。Check that you are providing a correct
ENDPOINT_ADDRESS_PROPERTY
and not the WSDL URL.