Package org.kiwiproject.jaxws
Class KiwiJaxWs
- java.lang.Object
-
- org.kiwiproject.jaxws.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 anSSLSocketFactory. 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 getNoClassDefFoundErrororClassNotFoundExceptionat runtime.
-
-
Field Summary
Fields Modifier and Type Field Description static intJAX_WS_DEFAULT_CONNECT_TIMEOUT_MILLISDefault value of the connect timeout in milliseconds.static intJAX_WS_DEFAULT_READ_TIMEOUT_MILLISDefault value of the read timeout in milliseconds.
-
Constructor Summary
Constructors Constructor Description KiwiJaxWs()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> TconfigureJdkWebService(Class<T> clazz, javax.xml.ws.BindingProvider bindingProvider, String serviceEndpointUri, SSLSocketFactory sslSocketFactory, int connectTimeoutMillis, int readTimeoutMillis)Configure a JDK (e.g.static voidconfigureJdkWebServiceConnectTimeout(javax.xml.ws.BindingProvider bindingProvider, int connectTimeoutMillis)Configure a JDK (e.g.static voidconfigureJdkWebServiceDefaultConnectTimeout(javax.xml.ws.BindingProvider bindingProvider)Configure a JDK (e.g.static voidconfigureJdkWebServiceDefaultReadTimeout(javax.xml.ws.BindingProvider bindingProvider)Configure a JDK (e.g.static voidconfigureJdkWebServiceEndpointAddress(javax.xml.ws.BindingProvider bindingProvider, String serviceEndpointUri)Configure a JDK (e.g.static voidconfigureJdkWebServiceEndpointAddress(javax.xml.ws.BindingProvider bindingProvider, URI serviceEndpointUri)Configure a JDK (e.g.static voidconfigureJdkWebServiceReadTimeout(javax.xml.ws.BindingProvider bindingProvider, int readTimeoutMillis)Configure a JDK (e.g.static voidconfigureJdkWebServiceSslSocketFactory(javax.xml.ws.BindingProvider bindingProvider, SSLSocketFactory sslSocketFactory)Configure a JDK (e.g.static <T> TconfigureJdkWebServiceWithDefaultTimeouts(Class<T> clazz, javax.xml.ws.BindingProvider bindingProvider, String serviceEndpointUri, SSLSocketFactory sslSocketFactory)Configure a JDK (e.g.
-
-
-
Field Detail
-
JAX_WS_DEFAULT_CONNECT_TIMEOUT_MILLIS
public static final int JAX_WS_DEFAULT_CONNECT_TIMEOUT_MILLIS
Default value of the connect timeout in milliseconds.- See Also:
JAXWSProperties.CONNECT_TIMEOUT,URLConnection.setConnectTimeout(int), Constant Field Values
-
JAX_WS_DEFAULT_READ_TIMEOUT_MILLIS
public static final int JAX_WS_DEFAULT_READ_TIMEOUT_MILLIS
Default value of the read timeout in milliseconds.- See Also:
JAXWSProperties.REQUEST_TIMEOUT,URLConnection.setReadTimeout(int), Constant Field Values
-
-
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 specifiedBindingProviderbindingProvider- theBindingProviderto configureserviceEndpointUri- the target service endpoint addresssslSocketFactory- 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 specifiedBindingProviderbindingProvider- theBindingProviderto configureserviceEndpointUri- the target service endpoint addresssslSocketFactory- the SSL socket factory to configure the web service to utilize when making secure callsconnectTimeoutMillis- the connect timeout in millisecondsreadTimeoutMillis- 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 serviceBindingProviderrequest context with the given SSL socket factory. This is a non-standard property specific to the reference implementation.- Parameters:
bindingProvider- theBindingProviderto configuresslSocketFactory- 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 serviceBindingProviderrequest context with the default connect timeout. This is a non-standard property specific to the reference implementation.- Parameters:
bindingProvider- theBindingProviderto 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 serviceBindingProviderrequest context with the given connect timeout in milliseconds.- Parameters:
bindingProvider- theBindingProviderto configureconnectTimeoutMillis- 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 serviceBindingProviderrequest context with the default read timeout. This is a non-standard property specific to the reference implementation.- Parameters:
bindingProvider- theBindingProviderto 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 serviceBindingProviderrequest context with the given read timeout in milliseconds.- Parameters:
bindingProvider- theBindingProviderto configurereadTimeoutMillis- 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 serviceBindingProviderrequest context with the given service endpoint URI.- Parameters:
bindingProvider- theBindingProviderto configureserviceEndpointUri- 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 serviceBindingProviderrequest context with the given service endpoint URI.- Parameters:
bindingProvider- theBindingProviderto configureserviceEndpointUri- the target service endpoint address- See Also:
BindingProvider.ENDPOINT_ADDRESS_PROPERTY
-
-