是否可以在jax-ws中更改http处理程序? 例如:从weblogic.net.http.HttpURLConnection到sun.net.www.protocol.http.HttpURLConnection。
答案 0 :(得分:6)
您可以尝试在网络博客中使用-DUseSunHttpHandler=true
。
使用WLST(非群集)
管理weblogic在$WLS_DOMAIN_HOME/bin/setDomainEnv.sh
JAVA_OPTIONS=-DUseSunHttpHandler=true
export JAVA_OPTIONS
使用Weblogic控制台管理weblogic(Clustered)
将-DUseSunHttpHandler=true
添加到a或b中的参数。
在管理控制台中,导航至Home
> Summary of Servers
&gt; <managed server name>
&gt; Configuration
&gt; Server Start
标签。
在包含xml-path $WLS_DOMAIN_HOME/config/config.xml
&gt;的配置文件server
中server-start
&gt; arguments
答案 1 :(得分:1)
实施您自己的URLConnectionFactory
,返回所需的HttpURLConnection
并在构建 Jersey 客户端时进行设置。
URLConnectionClientHandler urlConnectionClientHandler = new URLConnectionClientHandler(
new MyURLConnectionFactory());
Client client = new Client(urlConnectionClientHandler);