Axis HTTP Vs Axis HTTPS Proxy Settings

14,338

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().

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.

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?

Share:
14,338

Related videos on Youtube

Sankalp
Author by

Sankalp

Updated on September 19, 2022

Comments

  • Sankalp
    Sankalp over 1 year

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

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

    • 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)

    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);  
    

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

    My problem is as follows:

    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);
    

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

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

    or

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

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

    I also read in one of blog:

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

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

    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?

  • Sankalp
    Sankalp about 11 years
    Two things I want to point:the external web service I have used Axis 1.4 and for Internal Webservice I have created Java Classes using JAx-WS(through the Jdeveloper).I have corrected this in my question.In earlier post I had used System.setProperty....I have`t tried with AxisProperties.setProperty().
  • Lan
    Lan about 11 years
    Please try AxiProperties.setProperty() to see if it works, since this only affects Axis WS client, it is the recommended way.
  • Sankalp
    Sankalp about 11 years
    Sure, I will try tomorrow morning and let you know.Hope it helps
  • Lan
    Lan about 11 years
    No problem, glad I can help
  • Ben
    Ben over 6 years
    This post helped me to solve a javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection? As the compagny proxy was blocking the SSL connexion to my WS, I had to define a proxy via AxisProperties and bypass it with the option https.nonProxyHosts. Thank you !