title: SSLHandshakeException dynamic web project java
body: <p>In my Wicket application I would like to send data to a wsdl-endpoint with soap. To accomplish this, I made a dynamic web project in Eclipse (with Axis2). I get an error while connecting to the endpoint. The error is:</p>
  
  <blockquote>
    <p>Caused by: javax.net.ssl.SSLHandshakeException:
    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>The endpoint expects a username and password, with a preemptive connection.</p>
  
  <p>This is my code:</p>
  
  <pre><code>Deliver deliver = new Deliver();
  
  XmlDataList dataList = new XmlDataList();
  dataList.addXmlData(XML);   
  deliver.setXmlDataList(dataList);
  Stubstub = new Stub();
  
  Authenticator basicAuthenticator = new HttpTransportProperties.Authenticator();
  List&lt;String&gt; schemes= new ArrayList&lt;String&gt;();
  authSchemes.add(Authenticator.BASIC);
  basicAuthenticator.setAuthSchemes(schemes); 
  basicAuthenticator.setUsername("UName");
  basicAuthenticator.setPassword("Pwd");
  basicAuthenticator.setPreemptiveAuthentication(true);
  
  stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE, basicAuthenticator);
  </code></pre>
  
  <p>How can I set the preemptive conditions for connecting to a wsdl (https)? Can someone explain to me how this works?</p>
  
  <p>Thanks!</p>