title: Connection timed out trying to call asmx https web service from JAX-WS
body: <p>I'm trying to call an external web service whose endpoint is beyond https.</p>
  
  <p>We are trying to make the call with JAX-WS (Oracle standard implementation from Java EE 6).</p>
  
  <p>From SoapUI after setting the proxy it works correctly, but from our code we get this stack trace:</p>
  
  <pre><code>[11/13/12 12:46:55:389 CET] 00000024 SystemErr R javax.xml.ws.WebServiceException: java.net.ConnectException: Connection timed out: no further information
  [11/13/12 12:46:55:405 CET] 00000024 SystemErr R at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:175)
  [11/13/12 12:46:55:405 CET] 00000024 SystemErr R at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:70)
  [11/13/12 12:46:55:405 CET] 00000024 SystemErr R at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:128)
  [11/13/12 12:46:55:405 CET] 00000024 SystemErr R at org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.execute(AxisInvocationController.java:586)
  [11/13/12 12:46:55:405 CET] 00000024 SystemErr R at org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.doInvoke(AxisInvocationController.java:130)
  [11/13/12 12:46:55:405 CET] 00000024 SystemErr R at org.apache.axis2.jaxws.core.controller.impl.InvocationControllerImpl.invoke(InvocationControllerImpl.java:93)
  [11/13/12 12:46:55:405 CET] 00000024 SystemErr R at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(JAXWSProxyHandler.java:364)
  [11/13/12 12:46:55:405 CET] 00000024 SystemErr R at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(JAXWSProxyHandler.java:185)
  </code></pre>
  
  <p>We don't know why we obtain a connection timeout, because from SoapUI everything is ok...</p>
  
  <p>Here's the code we are using:</p>
  
  <pre><code>ResultBlock rb = null;
  Matching stub=new Matching();
  MatchingSoap soapPort = stub.getMatchingSoap();
  BindingProvider provider = (BindingProvider) soapPort;
  Map&lt;String, Object&gt; context = provider.getRequestContext();
  if(!"".equals("cvsa"))//Conf.getPROXY_URL()
  {
      System.getProperties().get("http.proxyPort");
      //Authenticator.setDefault(new ProxyAuthenticator("user", "password")); 
      System.getProperties().put("proxySet", "true");
      System.setProperty("http.proxyHost", "proxy.xxxxx.xxxx.xx"); 
      System.setProperty("http.proxyPort", "3128"); 
  }
  context.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "https://xxx.xxx.xxx.xxx/OnlineMatchingCore/OnlineMatching.asmx" );
  //context.put(JAXWSProperties.HTTP_CLIENT_STREAMING_CHUNK_SIZE, 8192);
  System.out.println(provider.getEndpointReference().toString());
  // Authenticator.setDefault(new ProxyAuthenticator("USER", "PASSWORD"));
  
  
  // Security.setProperty("ssl.SocketFactory.provider", "com.ibm.jsse2.SSLSocketFactoryImpl");
  // Security.setProperty("ssl.ServerSocketFactory.provider", "com.ibm.jsse2.SSLServerSocketFactoryImpl");
  
  String result = soapPort.match(controlXml, batchXml, "USER", "PASSWORD");
  </code></pre>
  
  <p>I saw lot of threads on the internet about problems like this, but I couldn't find any solution:</p>
  
  <ul>
  <li><p><a href="http://www.coderanch.com/t/566271/Web-Services/java/Invoking-HTTPS-webservice" rel="nofollow">Invoking HTTPS webservice</a> (already checked everything in this post)</p></li>
  <li><p><a href="http://beyondtech.ca/?p=73" rel="nofollow">JAX-WS invoking webservice using SSL throws the following exception</a> (already checked)</p></li>
  </ul>
  
  <p>I don't know what to try, my idea is that I'm missing something about telling java the webservice is on https...</p>