"便携及QUOT; JAX-WS客户端 [英] "Portable" JAX-WS client

查看:157
本文介绍了"便携及QUOT; JAX-WS客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我部署了一个JAX-WS服务,并使用wsimport来生成客户端代码。
因为我在本地主机上运行wsimport,所以我在binhost上找到了localhost地址的客户端代码。



但是我想在其他电脑上重用这些客户端代码它使用公共IP yyyy访问我部署的服务如何动态地使用这些(一次)生成的客户端代码访问我的服务。 (服务的ip可能会改变...)

解决方案

这是在 JAX-WS的常见问题解答


Q。如何为请求动态更改Web Service地址?

 ((BindingProvider)proxy).getRequestContext ).put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,...); 



I deployed a JAX-WS Service and use wsimport to generate client code. Because I run wsimport on localhost, I got the client code with binind on "localhost" address.

But I want to reuse those client code on other computers which access my deployed service with a public IP y.y.y.y. How can dynamically use those (once) generated client code to access my service. (The ip of service may change...)

解决方案

This is covered in the FAQ of JAX-WS:

Q. How can I change the Web Service address dynamically for a request ?

((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "..."); 

这篇关于"便携及QUOT; JAX-WS客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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