如何为在JBoss 4中运行的Web Service客户端配置HTTP代理? [英] How can I configure the HTTP proxy for a Web Service client running in JBoss 4?

查看:243
本文介绍了如何为在JBoss 4中运行的Web Service客户端配置HTTP代理?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用NetBeans 6.8我设法为在Internet中运行的服务编写了一个JAX-WS Web服务客户端。

Using NetBeans 6.8 I managed to write a JAX-WS Web Service client for a service which runs in the Internet.

在NetBeans中,通过HTTP防火墙进行通信

Within NetBeans, communication through the HTTP firewall works fine.

现在我试图在JBoss 4.2.3.GA中的Servlet中运行客户端,这里请求失败,并显示以下消息:

Now I tried to run the client in a Servlet in JBoss 4.2.3.GA, here the request fails with the message:

HTTP transport error: java.net.UnknownHostException: wwwcie.ups.com

所以我想,运行Servlet的VM不知道代理。我将尝试在Servlet代码中设置代理系统属性,但是也有一种方法可以在标准的JBoss配置文件中输入它,例如使用 PropertiesService

So I guess that the VM which runs the Servlet does not know the proxy. I will try to set the proxy system properties in the Servlet code, but maybe there is also a way to enter it in a standard JBoss configuration file for example using the PropertiesService?

推荐答案

我错过了服务URL错误消息仅显示服务器名称,而不显示协议部分)。

I missed the https in the service URL (the error message displays only the server name, not the protocol part).

必要的更改很简单,在PropertiesService配置文件中设置两个https(而不是http!)代理属性default / deploy / properties-service .xml

The necessary change is simple, set two https (not http!) proxy properties in the PropertiesService configuration file at default/deploy/properties-service.xml

<attribute name="Properties">
  ...  

  https.proxyHost=...
  https.proxyPort=...
</attribute>

这篇关于如何为在JBoss 4中运行的Web Service客户端配置HTTP代理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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