/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package runcreationservice; import com.heuristiclab.services.runcreation.Algorithm; import com.heuristiclab.services.runcreation.ArrayOfAlgorithm; import com.heuristiclab.services.runcreation.IRunCreationService; import com.heuristiclab.services.runcreation.RunCreationService; 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 GetAlgorithmsTest() { try { RunCreationService srv = new RunCreationService(new URL("https://services.heuristiclab.com/OKB.SPR.Java-3.3/RunCreationService.svc?wsdl")); IRunCreationService port = srv.getRunCreationService(); ArrayOfAlgorithm algos = port.getAlgorithms("HeuristicLab 3.3"); //Unknown"); for (Algorithm algo : algos.getAlgorithm()) { System.out.println("algo Id:=" + algo.getId()); System.out.println("algo AlgorithmClass:=" + algo.getAlgorithmClass()); System.out.println("algo DataType:=" + algo.getDataType()); System.out.println("algo Class:=" + algo.getClass()); System.out.println("algo Description:=" + algo.getDescription().getValue()); System.out.println("algo Name:=" + algo.getName().getValue()); } //assertTrue("No Algorithms found!", algos.getAlgorithm().size() > 0); //assertTrue("No Algorithms found!", algos.getAlgorithm().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.GetAlgorithmsTest(); } }