title: NetBeans: How to create a web service client that consumes a SSL protected Metro service?
body: <p>I am trying to add a web service reference to my application in NetBeans 7.0.1. The Metro webservice is protected with SSL and is hosted on the same computer that I want to run the client on. I am using the 'New Web Service Client' wizard, but when I submit an SSL protected WSDL, I get the following error message:</p>
  <blockquote>
  <p>Problem with downloading wsdl or schema file.</p>
  <p>Check the URL, proxy settings, or whether the server is running.</p>
  <p>URL: <a href="https://192.168.0.200:8181/MyApp/myService?wsdl" rel="nofollow noreferrer">https://192.168.0.200:8181/MyApp/myService?wsdl</a></p>
  </blockquote>
  <p>Metro User Guide - <a href="http://metro.java.net/guide/Example_Applications.html#gfrlg" rel="nofollow noreferrer">To Secure the Example Web Service Client Application (SSL)</a> states:</p>
  <blockquote>
  <p>In the step where you are directed to cut and paste the URL of the web service that you want the client to consume into the WSDL URL field, type https :// fully-qualified-hostname:8181 /CalculatorApplication/CalculatorWSService?wsdl (changes indicated in bold) to indicate that this client should reference the web service using the secure port. The first time you access this service, accept the certificate (s1as) when you are prompted. This is the server certificate popping up to confirm its identity to the client.</p>
  <p>In some cases, you might get an error dialog telling you that the URL https:// fully-qualified-hostname :8181/CalculatorApplication/CalculatorWSService?wsdl couldn't be downloaded. However, this the correct URL, and it does load when you run the service. So, when this error occurs, repeat the steps that create the Web Service Client using the secure WSDL. The second time, the web service reference is created and you can continue creating the client.</p>
  </blockquote>
  <p>No matter how many times I try I still get the same error message (there are no proxies set and the server is running with the services deployed). The WSDL gets displayed in browser after accepting the certificate. If I enter the basic WSDL URL (the one without HTTPS), the wizard accepts it and generates the client. What do I need to do to get this work?</p>
  <p><strong>UPDATE</strong></p>
  <p>The same applies if I run client and service on different machines. I am using the default development certificate. Retriever output:</p>
  <blockquote>
  <p>Error: An I/O error occured. sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target`</p>
  </blockquote>
  <p>Do I have to set keytore and truststore in VMargs? What if I want to have this service reference in the same web application that contains the web services?</p>