Class KiwiJaxWs


  • public class KiwiJaxWs
    extends Object
    Some JAX-WS utilities and constants. 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:
    JAXWSProperties.CONNECT_TIMEOUT, JAXWSProperties.REQUEST_TIMEOUT, JAXWSProperties.SSL_SOCKET_FACTORY, BindingProvider, BindingProvider.ENDPOINT_ADDRESS_PROPERTY, URLConnection.setConnectTimeout(int), URLConnection.setReadTimeout(int)
    Implementation Note:
    Note specifically that these use JAX-WS reference implementation vendor extension features that are available only when using the JAX-WS reference implementation. Specifically we are using constants in JAXWSProperties. If you are not using the reference implementation, 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.
    • Constructor Detail

      • KiwiJaxWs

        public KiwiJaxWs()
    • Method Detail

      • configureJdkWebServiceWithDefaultTimeouts

        public static <T> T configureJdkWebServiceWithDefaultTimeouts​(Class<T> clazz,
                                                                      javax.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:
        JAX_WS_DEFAULT_CONNECT_TIMEOUT_MILLIS, JAX_WS_DEFAULT_READ_TIMEOUT_MILLIS
      • configureJdkWebService

        public static <T> T configureJdkWebService​(Class<T> clazz,
                                                   javax.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​(javax.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​(javax.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:
        JAX_WS_DEFAULT_CONNECT_TIMEOUT_MILLIS, JAXWSProperties.CONNECT_TIMEOUT
      • configureJdkWebServiceConnectTimeout

        public static void configureJdkWebServiceConnectTimeout​(javax.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​(javax.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:
        JAX_WS_DEFAULT_READ_TIMEOUT_MILLIS, JAXWSProperties.REQUEST_TIMEOUT
      • configureJdkWebServiceReadTimeout

        public static void configureJdkWebServiceReadTimeout​(javax.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​(javax.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​(javax.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