0

I am trying to access a WSDL with the java application located at https://www.example.com:5242/calculator/calculatorport?wsdl but getting the above mentioned Error. But when i enter the same URL in the browser i am able to access the WSDL .

Full stacktrace follows:-

javax.xml.ws.WebServiceException: Failed to access the WSDL at: https://www.example.com:5242/calculator/calculatorport?wsdl. It failed with:
        HTTPS hostname wrong:  should be <www.example.com>.
        at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.tryWithMex(RuntimeWSDLParser.java:163)
        at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:145)
        at com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:267)
        at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:230)
        at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:178)
        at com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:93)
        at javax.xml.ws.Service.<init>(Service.java:67)
        at com.webservices.calculator.CalculatorService.<init>(CalculatorService.java:46)
        at com.testcl.Transfer.calculate(Transfer.java:118)
        at com.testcl.Transfer.run(Transfer.java:213)
        at java.lang.Thread.run(Thread.java:738)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:908)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:931)
        at java.lang.Thread.run(Thread.java:738)
Caused by: java.io.IOException: HTTPS hostname wrong:  should be <www.example.com>
        at com.ibm.net.ssl.www2.protocol.https.c.b(c.java:69)
        at com.ibm.net.ssl.www2.protocol.https.c.afterConnect(c.java:148)
        at com.ibm.net.ssl.www2.protocol.https.d.connect(d.java:12)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1207)
        at com.ibm.net.ssl.www2.protocol.https.b.getInputStream(b.java:32)
        at java.net.URL.openStream(URL.java:1022)
        at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.createReader(RuntimeWSDLParser.java:805)
        at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.resolveWSDL(RuntimeWSDLParser.java:263)
        at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:130)

What could be the issue ,Any help would be appreciated.

EDIT: The solution mentioned in the similar question is invalid in my case as the Certificate issued is of the CN www.example.com only.

Vishal Tyagi
  • 560
  • 9
  • 26
  • Can you connect to the WSDL URL using a simple Java client running on the same version of Java? – Anand Bhat Sep 27 '16 at 09:19
  • @AnandBhat No,cant connect – Vishal Tyagi Sep 27 '16 at 09:22
  • Without the domain name, it'd be hard to know why Java isn't trusting the certificate. Does the Java trust store you're using contain the CA root and is the server sending the full certificate chain, including intermediate certificates? – Anand Bhat Sep 27 '16 at 09:29
  • @AnandBhat How do i make sure the server is sending full chain?i have the certificate added to the java keystore – Vishal Tyagi Sep 28 '16 at 09:52
  • @AnandBhat i just got hold of the certificate that was added to the java keystore and it had .Which i think should be (please note that my actual URl which i morphed for the sake of privacy has sub as :- implws). Correct me if i am wrong. – Vishal Tyagi Sep 30 '16 at 09:56

0 Answers0