Package adams.flow.webservice
Class WebserviceUtils
- java.lang.Object
-
- adams.flow.webservice.WebserviceUtils
-
public class WebserviceUtils extends Object
Utility class around webservices.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Constructor Summary
Constructors Constructor Description WebserviceUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
configureClient(adams.flow.core.Actor owner, Object servicePort, int connection, int receive, String url, AbstractInInterceptorGenerator inInterceptor, AbstractOutInterceptorGenerator outInterceptor)
Sets the timeouts for connection and receiving.static void
configureServiceInterceptors(adams.flow.core.Actor owner, org.apache.cxf.jaxws.EndpointImpl endpoint, AbstractInInterceptorGenerator inInterceptor, AbstractOutInterceptorGenerator outInterceptor)
Configures the interceptors/logging for the service endpoint (incoming and outgoing).static Object
copyImplementation(Object implementation)
Creates a copy of the WS implementation, either using a shallow copy (if implementingOptionHandler
) orClassManager.deepCopy(Object)
.static void
disableSchemaValidation(BindingProvider provider)
Disables the schema validation.static void
enableSchemaValidation(BindingProvider provider)
Enables the schema validation.static String
loadWsdl(URL location)
Loads the WSDL from the given location.static String
wsdlToHtml(String wsdl)
Turns the WSDL content into content to be displayed as HTML.
-
-
-
Method Detail
-
enableSchemaValidation
public static void enableSchemaValidation(BindingProvider provider)
Enables the schema validation.- Parameters:
provider
- the webservice to enable schema validation for
-
disableSchemaValidation
public static void disableSchemaValidation(BindingProvider provider)
Disables the schema validation.- Parameters:
provider
- the webservice to disable schema validation for
-
configureClient
public static void configureClient(adams.flow.core.Actor owner, Object servicePort, int connection, int receive, String url, AbstractInInterceptorGenerator inInterceptor, AbstractOutInterceptorGenerator outInterceptor)
Sets the timeouts for connection and receiving. Also configures the proxy settings in case there is a system-wide proxy configured. Automatically configures TLS if present in actor's context.- Parameters:
owner
- the owning actorservicePort
- the service port to set the timeouts forconnection
- the timeout for the connection in msec, 0 is infinitereceive
- the timeout for receiving in msec, 0 is infiniteurl
- the URL of the webservice, null to use defaultinInterceptor
- the interceptor for incoming messages, null if not availableoutInterceptor
- the interceptor for outcoing messages, null if not available- See Also:
ProxyHelper
-
configureServiceInterceptors
public static void configureServiceInterceptors(adams.flow.core.Actor owner, org.apache.cxf.jaxws.EndpointImpl endpoint, AbstractInInterceptorGenerator inInterceptor, AbstractOutInterceptorGenerator outInterceptor)
Configures the interceptors/logging for the service endpoint (incoming and outgoing).- Parameters:
owner
- the owning actorendpoint
- the endpoint to configureinInterceptor
- the interceptor for incoming messagesoutInterceptor
- the interceptor for outcoing messages
-
loadWsdl
public static String loadWsdl(URL location)
Loads the WSDL from the given location.- Parameters:
location
- the location of the WSDL- Returns:
- the content of the WSDL, null if failed to load
-
wsdlToHtml
public static String wsdlToHtml(String wsdl)
Turns the WSDL content into content to be displayed as HTML.- Parameters:
wsdl
- the WSDL to convert- Returns:
- the HTML code
-
copyImplementation
public static Object copyImplementation(Object implementation)
Creates a copy of the WS implementation, either using a shallow copy (if implementingOptionHandler
) orClassManager.deepCopy(Object)
.- Parameters:
implementation
- the webservice implemntation to copy- Returns:
- the copy, null if failed to copy
-
-