Class KiwiJaxWs

java.lang.Object
org.kiwiproject.jaxws.KiwiJaxWs

public final class KiwiJaxWs extends Object
Some utilities and constants for Jakarta XML Web Services. These make use of specific features in the JDK/Apache CXF implementation in order to provide connect and read timeouts, as well as to provide an SSLSocketFactory. See the implementation note for more details if you are not using the JDK/Apache CXF implementations.
See Also:
Implementation Note:
Note specifically that these use Jakarta XML Web Services vendor extension features that are available only when using the the JDK/Apache CXF implementations. Specifically, we are using constants in JAXWSProperties. If you are not using the JDK implementation or Apache CXF, this will almost certainly not work. For one thing you won't have JAXWSProperties in your classpath, so will most likely get NoClassDefFoundError or ClassNotFoundException at runtime.
  • Field Details

  • Method Details

    • configureJdkWebServiceWithDefaultTimeouts

      public static <T> T configureJdkWebServiceWithDefaultTimeouts(Class<T> clazz, jakarta.xml.ws.BindingProvider bindingProvider, String serviceEndpointUri, SSLSocketFactory sslSocketFactory)
      Configure a JDK (e.g. Apache CXF-based) web service class with the given service endpoint address, SSL socket factory, and default timeout values.
      Type Parameters:
      T - the web service type
      Parameters:
      clazz - the class type of the specified BindingProvider
      bindingProvider - the BindingProvider to configure
      serviceEndpointUri - the target service endpoint address
      sslSocketFactory - the SSL socket factory to configure the web service to utilize when making secure calls
      Returns:
      the configured web service
      See Also:
    • configureJdkWebService

      public static <T> T configureJdkWebService(Class<T> clazz, jakarta.xml.ws.BindingProvider bindingProvider, String serviceEndpointUri, SSLSocketFactory sslSocketFactory, int connectTimeoutMillis, int readTimeoutMillis)
      Configure a JDK (e.g. Apache CXF-based) web service class with the given service endpoint address, SSL socket factory, and specified connect and read timeouts (in milliseconds).
      Type Parameters:
      T - the web service type
      Parameters:
      clazz - the class type of the specified BindingProvider
      bindingProvider - the BindingProvider to configure
      serviceEndpointUri - the target service endpoint address
      sslSocketFactory - the SSL socket factory to configure the web service to utilize when making secure calls
      connectTimeoutMillis - the connect timeout in milliseconds
      readTimeoutMillis - the read timeout in milliseconds
      Returns:
      the configured web service
    • configureJdkWebServiceSslSocketFactory

      public static void configureJdkWebServiceSslSocketFactory(jakarta.xml.ws.BindingProvider bindingProvider, SSLSocketFactory sslSocketFactory)
      Configure a JDK (e.g. Apache CXF-based) web service BindingProvider request context with the given SSL socket factory. This is a non-standard property specific to the reference implementation.
      Parameters:
      bindingProvider - the BindingProvider to configure
      sslSocketFactory - the SSL socket factory to configure the web service to utilize when making secure calls
      See Also:
      • JAXWSProperties.SSL_SOCKET_FACTORY
    • configureJdkWebServiceDefaultConnectTimeout

      public static void configureJdkWebServiceDefaultConnectTimeout(jakarta.xml.ws.BindingProvider bindingProvider)
      Configure a JDK (e.g. Apache CXF-based) web service BindingProvider request context with the default connect timeout. This is a non-standard property specific to the reference implementation.
      Parameters:
      bindingProvider - the BindingProvider to configure
      See Also:
    • configureJdkWebServiceConnectTimeout

      public static void configureJdkWebServiceConnectTimeout(jakarta.xml.ws.BindingProvider bindingProvider, int connectTimeoutMillis)
      Configure a JDK (e.g. Apache CXF-based) web service BindingProvider request context with the given connect timeout in milliseconds.
      Parameters:
      bindingProvider - the BindingProvider to configure
      connectTimeoutMillis - the connect timeout in milliseconds
      See Also:
      • JAXWSProperties.CONNECT_TIMEOUT
    • configureJdkWebServiceDefaultReadTimeout

      public static void configureJdkWebServiceDefaultReadTimeout(jakarta.xml.ws.BindingProvider bindingProvider)
      Configure a JDK (e.g. Apache CXF-based) web service BindingProvider request context with the default read timeout. This is a non-standard property specific to the reference implementation.
      Parameters:
      bindingProvider - the BindingProvider to configure
      See Also:
    • configureJdkWebServiceReadTimeout

      public static void configureJdkWebServiceReadTimeout(jakarta.xml.ws.BindingProvider bindingProvider, int readTimeoutMillis)
      Configure a JDK (e.g. Apache CXF-based) web service BindingProvider request context with the given read timeout in milliseconds.
      Parameters:
      bindingProvider - the BindingProvider to configure
      readTimeoutMillis - the read timeout in milliseconds
      See Also:
      • JAXWSProperties.REQUEST_TIMEOUT
    • configureJdkWebServiceEndpointAddress

      public static void configureJdkWebServiceEndpointAddress(jakarta.xml.ws.BindingProvider bindingProvider, String serviceEndpointUri)
      Configure a JDK (e.g. Apache CXF-based) web service BindingProvider request context with the given service endpoint URI.
      Parameters:
      bindingProvider - the BindingProvider to configure
      serviceEndpointUri - the target service endpoint address
      See Also:
      • BindingProvider.ENDPOINT_ADDRESS_PROPERTY
    • configureJdkWebServiceEndpointAddress

      public static void configureJdkWebServiceEndpointAddress(jakarta.xml.ws.BindingProvider bindingProvider, URI serviceEndpointUri)
      Configure a JDK (e.g. Apache CXF-based) web service BindingProvider request context with the given service endpoint URI.
      Parameters:
      bindingProvider - the BindingProvider to configure
      serviceEndpointUri - the target service endpoint address
      See Also:
      • BindingProvider.ENDPOINT_ADDRESS_PROPERTY