Axis HTTP Vs Axis HTTPS代理设置 [英] Axis HTTP Vs Axis HTTPS Proxy Settings

查看:983
本文介绍了Axis HTTP Vs Axis HTTPS代理设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

部署在Weblogic Cluster上的My Java应用程序调用两个Web服务,如下所示。

My Java application deployed on Weblogic Cluster invokes two Webservices which are as follow.

•它通过HTTPS将SOAP客户端请求发送到Internet上的外部应用程序。 (通过Axis 1.4创建的Java类)

• It sents SOAP Client request to External Application which is on internet) over HTTPS.(Java Classes created through Axis 1.4)

•此后它通过HTTP将SOAP客户端请求发送到内部应用程序(存在于连接到我的LAN的另一个节点上)。通过JAX-WS创建的Java类:Jdeveloper向导)

• Thereafter It sents SOAP Client request to internal Application(present on the other node which is connected to my LAN) over HTTP.(Java Classes created through JAX-WS:Jdeveloper Wizard)

为了达到第一个WS,我必须使用以下内容为Web服务客户端设置https代理设置代码:

In order to reach the 1st WS, I have to set the https proxy settings for the web service client using the following code:

System.setProperty("https.proxyHost", myProxyIP);  
System.setProperty("https.proxyPort", myProxyPort);  

而第二个Web服务不需要此代理设置,因为它们已在网络上可访问。

Whereas the 2nd Web services doesn't need this proxy setting because they're already reachable on the network.

我的问题如下:

如果我拨打第一项服务(具有代理设置的服务) ),然后调用另一个,Axis客户端尝试使用相同的代理设置调用这些服务,即使我在即将通过编写

If I call the 1st service (the one with the proxy setting), and then call the other , the Axis client tries to call these services with the same proxy setting, even if I remove the proxy setting from the System properties just before I am about to inoke the 2ns WS by writing

 System.setProperty("http.proxySet", "false");  
    System.getProperties().remove("http.proxyHost");  
    System.getProperties().remove("http.proxyPort");  
    AxisProperties.setProperty("http.proxyHost", null);  
    AxisProperties.setProperty("http.proxyPort", null);

我读somwhere使用nonProxyHosts.But我很困惑,如果我应该写

I read somwhere to use nonProxyHosts.But I am confused if should i write

System.setProperty("https.nonProxyHosts","secws.secondwsint.com");

System.setProperty("http.nonProxyHosts","secws.secondwsint.com");

http ot https,因为需要绕过的是HTTP和我们设置代理的那个是HTTPS。

http ot https, since the one that need to be bypassed is HTTP and the one we are setting proxy is HTTPS.

我还在博客中读到:

AxisProperties.setProperty("https.proxyHost", "bla1.bla1"); 
AxisProperties.setProperty("https.proxyPort", "8080"); 
AxisProperties.setProperty("https.nonProxyHosts", "secws.secondwsint.com"); 

但是再一次使用https.nonProxyHosts或http.nonProxyHosts

but again confued wheather to use https.nonProxyHosts or http.nonProxyHosts

建议在我的java程序中使用哪一个 System.setProperty AxisProperties.setProperty 并且重要的是我应该使用http ot https编写该代码行
此外,还有其他选择吗?

Which one would be advisable to use in my java program System.setProperty or AxisProperties.setProperty and importantly should i use http ot https for writing that codeline Also, Is there any other alternative?

推荐答案

你可以使用两者。但System.setProperty()也会影响VM中其他与HTTP相关的java函数,而AxisProperties仅影响Axis WS客户端。所以我将选择AxisProperties.setProperty()。

You can use both. But The System.setProperty() will also affect other HTTP related java function in your VM, while AxisProperties only affects Axis WS client. So I will pick AxisProperties.setProperty().

Axis中有一个错误 http代理参数缓存机制的问题。基本上,实现缓存旧代理设置,不读取新设置。因此,即使您使用 AxisProperties.setProperty()方法,它仍然无效。我不确定它是否适用于Axis 1.4,因为JIRA不提供受影响的版本号。

There is a bug in Axis problem with http proxy parameters caching mechanism . Basically the implementation caches the old proxy setting and does not read new settings. So even if you use AxisProperties.setProperty() method, it still does not work. I am not sure if it applies to Axis 1.4 or not, as the JIRA does not provide affected version number.

我还认为你应该设置http.nonProxyHosts,因为你的内部WS使用HTTP,而不是HTTPS。但是在另一篇文章中,你提到你设置了它们并且它不起作用。那还是这样吗?

I also believe you should set http.nonProxyHosts because your internal WS uses HTTP, not HTTPS. But in another post, you mentioned that you set both and it does not work. Is that still the case?

这篇关于Axis HTTP Vs Axis HTTPS代理设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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