Search in sources :

Example 1 with SHSIMPINC

use of com.ibm.maximo.wsdl.shsimpinc.SHSIMPINC in project opennms by OpenNMS.

the class TsrmTicketerPlugin method getService.

private SHSIMPINCPortType getService() {
    final SHSIMPINC service = new SHSIMPINC();
    port = service.getSHSIMPINCSOAP12Port();
    final Client cxfClient = ClientProxy.getClient(port);
    try {
        cxfClient.getRequestContext().put(Message.ENDPOINT_ADDRESS, getProperties().getProperty("tsrm.url"));
        final HTTPConduit http = (HTTPConduit) cxfClient.getConduit();
        String stictSSL = getProperties().getProperty("tsrm.ssl.strict");
        if (!Boolean.parseBoolean(stictSSL)) {
            LOG.debug("Disabling strict SSL checking.");
            // Accept all certificates
            final TrustManager[] simpleTrustManager = new TrustManager[] { new AnyServerX509TrustManager() };
            final TLSClientParameters tlsParams = new TLSClientParameters();
            tlsParams.setTrustManagers(simpleTrustManager);
            tlsParams.setDisableCNCheck(true);
            http.setTlsClientParameters(tlsParams);
        }
    } catch (IOException e) {
        LOG.error("Unable to load tsrm properties ", e);
    }
    // Log incoming and outgoing requests
    LoggingInInterceptor loggingInInterceptor = new LoggingInInterceptor();
    loggingInInterceptor.setPrettyLogging(true);
    cxfClient.getInInterceptors().add(loggingInInterceptor);
    LoggingOutInterceptor loggingOutInterceptor = new LoggingOutInterceptor();
    loggingOutInterceptor.setPrettyLogging(true);
    cxfClient.getOutInterceptors().add(loggingOutInterceptor);
    return port;
}
Also used : HTTPConduit(org.apache.cxf.transport.http.HTTPConduit) TLSClientParameters(org.apache.cxf.configuration.jsse.TLSClientParameters) LoggingOutInterceptor(org.apache.cxf.interceptor.LoggingOutInterceptor) LoggingInInterceptor(org.apache.cxf.interceptor.LoggingInInterceptor) AnyServerX509TrustManager(org.opennms.core.utils.AnyServerX509TrustManager) IOException(java.io.IOException) Client(org.apache.cxf.endpoint.Client) SHSIMPINC(com.ibm.maximo.wsdl.shsimpinc.SHSIMPINC) AnyServerX509TrustManager(org.opennms.core.utils.AnyServerX509TrustManager) TrustManager(javax.net.ssl.TrustManager)

Aggregations

SHSIMPINC (com.ibm.maximo.wsdl.shsimpinc.SHSIMPINC)1 IOException (java.io.IOException)1 TrustManager (javax.net.ssl.TrustManager)1 TLSClientParameters (org.apache.cxf.configuration.jsse.TLSClientParameters)1 Client (org.apache.cxf.endpoint.Client)1 LoggingInInterceptor (org.apache.cxf.interceptor.LoggingInInterceptor)1 LoggingOutInterceptor (org.apache.cxf.interceptor.LoggingOutInterceptor)1 HTTPConduit (org.apache.cxf.transport.http.HTTPConduit)1 AnyServerX509TrustManager (org.opennms.core.utils.AnyServerX509TrustManager)1