/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package queryservice; import java.net.MalformedURLException; import java.net.URL; import java.security.KeyManagementException; import java.security.NoSuchAlgorithmException; import java.util.logging.Level; import java.util.logging.Logger; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManager; import javax.net.ssl.X509TrustManager; /** * * @author MartinH */ public class Main { static { // Create a trust manager that does not validate certificate chains TrustManager[] trustAllCerts = new TrustManager[]{new X509TrustManager() { public java.security.cert.X509Certificate[] getAcceptedIssuers() { return new java.security.cert.X509Certificate[]{}; } public void checkClientTrusted( java.security.cert.X509Certificate[] certs, String authType) { } public void checkServerTrusted( java.security.cert.X509Certificate[] certs, String authType) { } }}; SSLContext sc; try { sc = SSLContext.getInstance("SSL"); sc.init(null, trustAllCerts, new java.security.SecureRandom()); HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e); } catch (KeyManagementException e) { throw new RuntimeException(e); } } // public void GetFiltersTest() { // try { // QueryService srv = new QueryService(new URL("https://services.heuristiclab.com/OKB.SPR.Java-3.3/QueryService.svc?wsdl")); // IQueryService port = srv.getQueryService(); // // ArrayOfFilter filters = port.getFilters(); // for (Filter filter : filters.getFilter()) { // System.out.println("filter TypeName:=" + filter.getFilterTypeName().getValue()); // System.out.println("filter Label:=" + filter.getLabel().getValue()); // System.out.println("filter Class:=" + filter.getClass().getName()); // } // //assertTrue("No Filters found!", filters.getFilter().size() > 0); // //assertTrue("No Filters found!", filters.getFilter().size() > 0); // } catch (MalformedURLException ex) { // Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex); // } // } /** * @param args the command line arguments */ public static void main(String[] args) { Main test = new Main(); // test.GetFiltersTest(); } }