title: Consuming a WebService over SSL in Java
body: <p>I want to consume a web service in Java and I am using JAX.WS. Everything is working fine until I try to consume a webservice over SSL (https). I have added the certificate of the site  to keystore using keytool. Still no success. Anyone has done it before ? The webservice is from a third party payment gateway like paypal-payflo etc... so regular webservice whose certificate comes from Verisign. Any tip would help. It is a SOAP webservice with wsdl.</p>
  
  <p>The error trace:</p>
  
  <blockquote>
    <p>Exception in thread "main" javax.xml.ws.WebServiceException: Failed to
    access the WSDL at:
    xxxxx.xxxxxx.xxx/creditcardWS/CreditCardService/v1?wsdl. It failed
    with: Got Connection refused: connect while opening stream from
    xxxxxx.xxxxxx.xxx/creditcardWS/CreditCardService/v1?wsdl. at
    com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.tryWithMex(RuntimeWSDLPars‌​er.java:173)
    at
    com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.ja‌​va:155)
    at
    com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.ja‌​va:120)
    at 
    com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.jav‌​a:260)
    at
    com.sun.xml.internal.ws.client.WSServiceDelegate.(WSServiceDelegate.java:2‌​23)
    at
    com.sun.xml.internal.ws.client.WSServiceDelegate.(WSServiceDelegate.java:1‌​71)
    at
    com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java‌​:96)</p>
  </blockquote>