如何在 WebServiceTemplate 上设置代理服务器详细信息 [英] how to set proxy server details on WebServiceTemplate

查看:15
本文介绍了如何在 WebServiceTemplate 上设置代理服务器详细信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 SOAP 网络服务端点 url(比方说:EP1"),我们可以通过代理服务器连接它.

I have a SOAP webservice endpoint url(let's say :"EP1") which we can connect only through a proxy server.

我们正在使用 org.springframework.ws.client.core.WebServiceTemplate 类来使用网络服务.

We are using org.springframework.ws.client.core.WebServiceTemplate class to consume webservices.

我的问题是,有没有办法可以在 WebServiceTemplate 上传递/设置代理服务器详细信息以连接到端点 URLEP1"?

My question is, Is there a way that I can pass/set the proxy server details on WebServiceTemplate to connect to endpoint url "EP1"?

推荐答案

您必须使用 VM 参数:-Dhttp.proxyHost=mydomain.com -Dhttp.proxyPort=8080

You must use VM arguments: -Dhttp.proxyHost=mydomain.com -Dhttp.proxyPort=8080

请记住,此设置适用于从 Java 发出的所有 HTTP 请求.

Having in mind that this setting applies to all HTTP requests made from Java.

这篇关于如何在 WebServiceTemplate 上设置代理服务器详细信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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