Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/07/11 18:34:30 (14 years ago)
Author:
bfarka
Message:

restructure of service project #1218

Location:
branches/OKBJavaConnector/HLOKBWebClient/src/main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/OKBJavaConnector/HLOKBWebClient/src/main/java/at/hl/okb/wsclient/OKBServiceClient.java

    r5229 r5233  
    33import static at.hl.okb.wsclient.Utilities.createNameFilter;
    44
     5import java.security.KeyManagementException;
     6import java.security.NoSuchAlgorithmException;
    57import java.util.ArrayList;
    68import java.util.HashMap;
     
    810import java.util.Map;
    911
    10 import javax.xml.bind.JAXBElement;
    11 import javax.xml.namespace.QName;
    12 
    13 import com.google.common.collect.Iterables;
     12import javax.net.ssl.HttpsURLConnection;
     13import javax.net.ssl.SSLContext;
     14import javax.net.ssl.TrustManager;
     15import javax.net.ssl.X509TrustManager;
    1416
    1517import at.hl.wsclient.okb.Algorithm;
     
    1719import at.hl.wsclient.okb.ArrayOfAlgorithm;
    1820import at.hl.wsclient.okb.ArrayOfAlgorithmParameter;
    19 import at.hl.wsclient.okb.ArrayOfPlatform;
    2021import at.hl.wsclient.okb.ArrayOfProblem;
    2122import at.hl.wsclient.okb.IOKBService;
     
    2526import at.hl.wsclient.okb.Problem;
    2627
     28import com.google.common.collect.Iterables;
     29
    2730public class OKBServiceClient {
    2831    OKBService srv = null;
    2932    IOKBService port = null;
    3033
     34    // hack for allowing self signed certificates
     35    static {
     36  // Create a trust manager that does not validate certificate chains
     37  TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {
     38      public java.security.cert.X509Certificate[] getAcceptedIssuers() {
     39    return new java.security.cert.X509Certificate[] {};
     40      }
     41
     42      public void checkClientTrusted(
     43        java.security.cert.X509Certificate[] certs, String authType) {
     44      }
     45
     46      public void checkServerTrusted(
     47        java.security.cert.X509Certificate[] certs, String authType) {
     48      }
     49  } };
     50
     51  SSLContext sc;
     52  try {
     53      sc = SSLContext.getInstance("SSL");
     54      sc.init(null, trustAllCerts, new java.security.SecureRandom());
     55      HttpsURLConnection
     56        .setDefaultSSLSocketFactory(sc.getSocketFactory());
     57  } catch (NoSuchAlgorithmException e) {
     58      throw new RuntimeException(e);
     59  } catch (KeyManagementException e) {
     60      throw new RuntimeException(e);
     61  }
     62
     63    }
     64
    3165    public OKBServiceClient() {
    3266  this.srv = new OKBService();
    33   this.port = srv.getWSHttpBindingIOKBService();
     67  this.port = srv.getWSHttpBindingIOKBService1();
    3468    }
    3569
     
    4882
    4983    private void createPlatform(String name) {
    50  
     84
    5185  ObjectFactory factory = new ObjectFactory();
    5286  Platform platform = factory.createPlatform();
    53  
     87
    5488  platform.setName(factory.createNamedOKBItemName(name));
    5589  port.addPlatform(platform);
  • branches/OKBJavaConnector/HLOKBWebClient/src/main/resources/OKBService.xml

    r4955 r5233  
    20532053          <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
    20542054            <X509Data>
    2055               <X509Certificate>MIIB7jCCAVugAwIBAgIQXxe3/zOBlYpBpwBjMEbJ4DAJBgUrDgMCHQUAMBQxEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0xMDEwMDgxNzE2MTFaFw0zOTEyMzEyMzU5NTlaMBQxEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAzU+W3f1o9F66BJYnw2RwOfPBWYIUsz3B2A1mNbI7a6kjJmR8qKp/bi5dN6SJxOE0HRSpRXtebU2dvPR78haVgvBSAGVc7FNFpzC7vd64qIcTiUnWz6r7Z4tb11IC8HSyFg/XBUAxEJUB88zOi1uSvf5CAnPDdSEhjF67tPEeFDkCAwEAAaNJMEcwRQYDVR0BBD4wPIAQ5KbnDDhtrCbHXkz79n0QA6EWMBQxEjAQBgNVBAMTCWxvY2FsaG9zdIIQXxe3/zOBlYpBpwBjMEbJ4DAJBgUrDgMCHQUAA4GBAC2A/h0HV1CUKqB9x2wxGE4Vjx8K8Xad4zcYNiXC/TxE09jMVJlN2k0OeBWM6Y4bhkxwtFfP0ZTH/4sIv+6hfY0ApDEmWdVtQHs6CIzTjc7Mm7aW8my5dvo90tkm2IgPR/qJeBG7kNAeiqEAHCp2Xn3UZ5i9Y7s9QN7vS7MtxASa
    2056               </X509Certificate>
     2055              <!-- <X509Certificate>MIIB7jCCAVugAwIBAgIQXxe3/zOBlYpBpwBjMEbJ4DAJBgUrDgMCHQUAMBQxEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0xMDEwMDgxNzE2MTFaFw0zOTEyMzEyMzU5NTlaMBQxEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAzU+W3f1o9F66BJYnw2RwOfPBWYIUsz3B2A1mNbI7a6kjJmR8qKp/bi5dN6SJxOE0HRSpRXtebU2dvPR78haVgvBSAGVc7FNFpzC7vd64qIcTiUnWz6r7Z4tb11IC8HSyFg/XBUAxEJUB88zOi1uSvf5CAnPDdSEhjF67tPEeFDkCAwEAAaNJMEcwRQYDVR0BBD4wPIAQ5KbnDDhtrCbHXkz79n0QA6EWMBQxEjAQBgNVBAMTCWxvY2FsaG9zdIIQXxe3/zOBlYpBpwBjMEbJ4DAJBgUrDgMCHQUAA4GBAC2A/h0HV1CUKqB9x2wxGE4Vjx8K8Xad4zcYNiXC/TxE09jMVJlN2k0OeBWM6Y4bhkxwtFfP0ZTH/4sIv+6hfY0ApDEmWdVtQHs6CIzTjc7Mm7aW8my5dvo90tkm2IgPR/qJeBG7kNAeiqEAHCp2Xn3UZ5i9Y7s9QN7vS7MtxASa
     2056              </X509Certificate>
     2057              <X509Certificate>MIIB7jCCAVugAwIBAgIQ0meBmhk5CIFPO5UnHjhOUjAJBgUrDgMCHQUAMBQxEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0xMTAxMDcxNDAwMzZaFw0zOTEyMzEyMzU5NTlaMBQxEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuLYzZApEB/L9S7GWjvERJabg85yL3hZttvQNmBss2vQdE8cJnn9fBTKo8itl0XkGDGtY5Iz3zsR8fsqL7cNCUnMl/c+C5CNz7vYa8U7xf38q6udFx1NL7EMR9V1SfTyCXkOqiMb2NqX6yw1Rq9QYe+VnVL5k3hZtoLuyKAPuJk0CAwEAAaNJMEcwRQYDVR0BBD4wPIAQMzdxtx7LYu7RVs3k80vXj6EWMBQxEjAQBgNVBAMTCWxvY2FsaG9zdIIQ0meBmhk5CIFPO5UnHjhOUjAJBgUrDgMCHQUAA4GBACItYyuXIJJdA32tI8q8kxolwhWZHeJ1wSkoqhU8zOJQTIHS2gFjNgHC8gPQhoV9g9hZ9WGj07F9/VL6F9ziKbXLaYtXv8lzoYOD5iodF8/35Ew4O9tbwFXrNbZBQqk7ZrZF9G15aAH408zoMc/quURFzQKkBa3Z9Apz/l36ewtb
     2058              </X509Certificate>-->
    20572059            </X509Data>
    20582060          </KeyInfo>
     
    20692071          <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
    20702072            <X509Data>
    2071               <X509Certificate>MIIB7jCCAVugAwIBAgIQXxe3/zOBlYpBpwBjMEbJ4DAJBgUrDgMCHQUAMBQxEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0xMDEwMDgxNzE2MTFaFw0zOTEyMzEyMzU5NTlaMBQxEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAzU+W3f1o9F66BJYnw2RwOfPBWYIUsz3B2A1mNbI7a6kjJmR8qKp/bi5dN6SJxOE0HRSpRXtebU2dvPR78haVgvBSAGVc7FNFpzC7vd64qIcTiUnWz6r7Z4tb11IC8HSyFg/XBUAxEJUB88zOi1uSvf5CAnPDdSEhjF67tPEeFDkCAwEAAaNJMEcwRQYDVR0BBD4wPIAQ5KbnDDhtrCbHXkz79n0QA6EWMBQxEjAQBgNVBAMTCWxvY2FsaG9zdIIQXxe3/zOBlYpBpwBjMEbJ4DAJBgUrDgMCHQUAA4GBAC2A/h0HV1CUKqB9x2wxGE4Vjx8K8Xad4zcYNiXC/TxE09jMVJlN2k0OeBWM6Y4bhkxwtFfP0ZTH/4sIv+6hfY0ApDEmWdVtQHs6CIzTjc7Mm7aW8my5dvo90tkm2IgPR/qJeBG7kNAeiqEAHCp2Xn3UZ5i9Y7s9QN7vS7MtxASa
    2072               </X509Certificate>
     2073              <!-- <X509Certificate>MIIB7jCCAVugAwIBAgIQXxe3/zOBlYpBpwBjMEbJ4DAJBgUrDgMCHQUAMBQxEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0xMDEwMDgxNzE2MTFaFw0zOTEyMzEyMzU5NTlaMBQxEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAzU+W3f1o9F66BJYnw2RwOfPBWYIUsz3B2A1mNbI7a6kjJmR8qKp/bi5dN6SJxOE0HRSpRXtebU2dvPR78haVgvBSAGVc7FNFpzC7vd64qIcTiUnWz6r7Z4tb11IC8HSyFg/XBUAxEJUB88zOi1uSvf5CAnPDdSEhjF67tPEeFDkCAwEAAaNJMEcwRQYDVR0BBD4wPIAQ5KbnDDhtrCbHXkz79n0QA6EWMBQxEjAQBgNVBAMTCWxvY2FsaG9zdIIQXxe3/zOBlYpBpwBjMEbJ4DAJBgUrDgMCHQUAA4GBAC2A/h0HV1CUKqB9x2wxGE4Vjx8K8Xad4zcYNiXC/TxE09jMVJlN2k0OeBWM6Y4bhkxwtFfP0ZTH/4sIv+6hfY0ApDEmWdVtQHs6CIzTjc7Mm7aW8my5dvo90tkm2IgPR/qJeBG7kNAeiqEAHCp2Xn3UZ5i9Y7s9QN7vS7MtxASa
     2074              </X509Certificate>
     2075              <X509Certificate>MIIB7jCCAVugAwIBAgIQ0meBmhk5CIFPO5UnHjhOUjAJBgUrDgMCHQUAMBQxEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0xMTAxMDcxNDAwMzZaFw0zOTEyMzEyMzU5NTlaMBQxEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuLYzZApEB/L9S7GWjvERJabg85yL3hZttvQNmBss2vQdE8cJnn9fBTKo8itl0XkGDGtY5Iz3zsR8fsqL7cNCUnMl/c+C5CNz7vYa8U7xf38q6udFx1NL7EMR9V1SfTyCXkOqiMb2NqX6yw1Rq9QYe+VnVL5k3hZtoLuyKAPuJk0CAwEAAaNJMEcwRQYDVR0BBD4wPIAQMzdxtx7LYu7RVs3k80vXj6EWMBQxEjAQBgNVBAMTCWxvY2FsaG9zdIIQ0meBmhk5CIFPO5UnHjhOUjAJBgUrDgMCHQUAA4GBACItYyuXIJJdA32tI8q8kxolwhWZHeJ1wSkoqhU8zOJQTIHS2gFjNgHC8gPQhoV9g9hZ9WGj07F9/VL6F9ziKbXLaYtXv8lzoYOD5iodF8/35Ew4O9tbwFXrNbZBQqk7ZrZF9G15aAH408zoMc/quURFzQKkBa3Z9Apz/l36ewtb
     2076              </X509Certificate>-->
    20732077            </X509Data>
    20742078          </KeyInfo>
     
    20822086        <sc:CallbackHandlerConfiguration
    20832087          wspp:visibility="private">
    2084           <sc:CallbackHandler default="MartinH" name="usernameHandler" />
    2085           <sc:CallbackHandler default="mh2404" name="passwordHandler" />
     2088          <sc:CallbackHandler default="fab" name="usernameHandler" />
     2089          <sc:CallbackHandler default="fab123" name="passwordHandler" />
    20862090        </sc:CallbackHandlerConfiguration>
    20872091
Note: See TracChangeset for help on using the changeset viewer.