title: SOAP calls through a SOCKS Proxy in Java
body: <p>I have a situation where I communicate with a vendor via <code>REST</code> services.  Within our organization there are firewalls galore, and doing this sort of thing requires the use of a specific <code>SOCKS</code> proxy configuration.<br>
  Note that it must be this <code>SOCKS</code> proxy; an <code>HTTP</code> proxy will not work in our environment.<br>
  Once the proxy configurations were done, the connection through the proxy is handled with relative ease using the code below:</p>
  
  <pre><code>URL url = new URL("https://url.for.the.web.service.com");
  Proxy proxy = new Proxy(Proxy.Type.SOCKS,new InetSocketAddress("our.socks.proxy.server.com",1080));
  HttpsURLConnection con = (HttpsURLConnection)url.openConnection(proxy);
  </code></pre>
  
  <p>I have received an additional requirement to attach to some additional web services for the vendor.  Unfortunately, these are older handling for the vendor and are done as <code>SOAP</code> services.<br>
  Although I'm old and grizzled, this is my first run at client side <code>SOAP</code>.  Using the help I already got from your site (thanks for the site btw; I use it all the time for reference, including getting through the REST implementation and first round of <code>SOCKS</code> last spring), I was able to get my <code>SOAP</code> proxy classes generated through Eclipse.  But when I try to run the generated code to access a service I run straight into the firewall, because it is not being specified in that generated code.</p>
  
  <p>I've been looking through it and I think I've identified the generated class where my changes need to go, that being the WSDLName_Locator class extended from the Axis client class Service.  Although I can find a URL object for the WSDL location in the generated code, there is no equivalent opening of a connection to which I can attach my <code>SOCKS</code> proxy.  The handling goes down into the bowels of the Axis handling and does I know not what.  It may alternatively be in the <code>BasicHttpBinding_IWSDLNameStub</code>.</p>
  
  <p>I've been googling and looking at Javadoc for every class used in that generated code, looking for any references to proxy and I'm coming up empty.  But this is complicated by the fact that in the SOAP vernacular the generated code itself is called a proxy, so I get large numbers of false positives on any search I try, and also by the fact that all of the more recent info online seems to relate to Android app development, which I am not doing.  The AxisEngine and AxisEngineConfiguration classes seem promising, but I haven’t found a way to connect a proxy there either.</p>
  
  <p>My need is simply this: where and how in that generated SOAP code can I do the equivalent attachment to the proxy, so that that linkage is carried into the Axis handling?  My hope is that someone has done this before.</p>
  
  <p>I haven’t included any of the generated code because I would need to obfuscate it beyond the ability to run anyway, it's voluminous because it covers a number of services, and my assumption is that the generated output is similar from one WSDL generation to the next.  But I will provide any additional detail that is required.</p>
  
  <p>Thanks in advance for any help you can provide.</p>