更新时间:2023-12-01 08:07:52
这由JAX-WS规范涵盖。基本上,在请求上下文中将用户名/密码设置为属性:
This is covered by the JAX-WS Specification. Basically, set the username/password as properties on the request context:
((BindingProvider)proxy).getRequestContext().put(
BindingProvider.USERNAME_PROPERTY, "joe");
((BindingProvider)proxy).getRequestContext().put(
BindingProvider.PASSWORD_PROPERTY, "pswd");
运行时将它们放入HTTP标头。
The runtime puts them into the HTTP header.