Class WSProxyFactory
java.lang.Object
com.webmethods.caf.wsclient.proxy.impl.WSProxyFactory
- All Implemented Interfaces:
IWSProxyFactory
Default implementation of
IWSProxyFactory
-
Constructor Summary
ConstructorsConstructorDescriptionWSProxyFactory
(WSClientConfig clientConfig) Default constructor that creates a new WSProxyFactory with the specified configuration object -
Method Summary
Modifier and TypeMethodDescriptionint
Hint for theIWSCacheManager
long
Hint for theIWSCacheManager
Get the time-to-live of cached web service results.getProxy
(Class<?> clazz, String wsdlURL, String[] mapURLs, String endPointURL, boolean useCache, boolean reuseSession) getProxy
(Class<?> clazz, String wsdlURL, String[] mapURLs, String endPointURL, boolean useCache, boolean reuseSession, int socketTimeout, AuthCredentials authCredentials) This will obtain a Proxy that can be used for invoking the target webServicegetProxy
(Class<?> clazz, String wsdlURL, String[] mapURLs, String endPointURL, boolean useCache, boolean reuseSession, AuthCredentials authCredentials) getProxy
(Class<?> clazz, String wsdlURL, String endPointURL, boolean useCache, boolean reuseSession) getProxy
(Class<?> clazz, String wsdlURL, String endPointURL, boolean useCache, boolean reuseSession, int socketTimeout, AuthCredentials authCredentials) This will obtain a Proxy that can be used for invoking the target webServicegetProxy
(Class<?> clazz, String wsdlURL, String endPointURL, boolean useCache, boolean reuseSession, AuthCredentials authCredentials) int
Get the default socket timeout.void
setCacheCapacity
(int capacity) Hint for theIWSCacheManager
Set the initial capacity of the web service results cachevoid
setCacheTimeout
(long ms) Hint for theIWSCacheManager
Sets the time-to-live for items in the web service results cachevoid
setSocketTimeout
(int socketTimeout) Set the default socket timeout.
-
Constructor Details
-
WSProxyFactory
Default constructor that creates a new WSProxyFactory with the specified configuration object- Parameters:
clientConfig
-WSClientConfig
object containing WSClient configuration options
-
-
Method Details
-
getProxy
public IWSClientProxy getProxy(Class<?> clazz, String wsdlURL, String endPointURL) throws WSClientException - Specified by:
getProxy
in interfaceIWSProxyFactory
- Throws:
WSClientException
- See Also:
-
getProxy
public IWSClientProxy getProxy(Class<?> clazz, String wsdlURL, String[] mapURLs, String endPointURL) throws WSClientException - Specified by:
getProxy
in interfaceIWSProxyFactory
- Throws:
WSClientException
- See Also:
-
getProxy
public IWSClientProxy getProxy(Class<?> clazz, String wsdlURL, String endPointURL, boolean useCache) throws WSClientException - Specified by:
getProxy
in interfaceIWSProxyFactory
- Throws:
WSClientException
- See Also:
-
getProxy
public IWSClientProxy getProxy(Class<?> clazz, String wsdlURL, String[] mapURLs, String endPointURL, boolean useCache) throws WSClientException - Specified by:
getProxy
in interfaceIWSProxyFactory
- Throws:
WSClientException
- See Also:
-
getProxy
public IWSClientProxy getProxy(Class<?> clazz, String wsdlURL, String endPointURL, boolean useCache, boolean reuseSession) throws WSClientException - Specified by:
getProxy
in interfaceIWSProxyFactory
- Throws:
WSClientException
- See Also:
-
getProxy
public IWSClientProxy getProxy(Class<?> clazz, String wsdlURL, String[] mapURLs, String endPointURL, boolean useCache, boolean reuseSession) throws WSClientException - Specified by:
getProxy
in interfaceIWSProxyFactory
- Throws:
WSClientException
- See Also:
-
getProxy
public IWSClientProxy getProxy(Class<?> clazz, String wsdlURL, String endPointURL, boolean useCache, boolean reuseSession, AuthCredentials authCredentials) throws WSClientException - Specified by:
getProxy
in interfaceIWSProxyFactory
- Throws:
WSClientException
- See Also:
-
getProxy
public IWSClientProxy getProxy(Class<?> clazz, String wsdlURL, String[] mapURLs, String endPointURL, boolean useCache, boolean reuseSession, AuthCredentials authCredentials) throws WSClientException - Specified by:
getProxy
in interfaceIWSProxyFactory
- Throws:
WSClientException
- See Also:
-
getProxy
public IWSClientProxy getProxy(Class<?> clazz, String wsdlURL, String endPointURL, boolean useCache, boolean reuseSession, int socketTimeout, AuthCredentials authCredentials) throws WSClientException Description copied from interface:IWSProxyFactory
This will obtain a Proxy that can be used for invoking the target webService- Specified by:
getProxy
in interfaceIWSProxyFactory
- Parameters:
clazz
- the interface of the target webServicewsdlURL
- the location of the WSDL describing the webServiceendPointURL
- the endpoint URL of the webServiceuseCache
- whether to use results from the cache if presentreuseSession
- if a previous session is available for the specified user, whether to reuse itsocketTimeout
- timeout for socket connections (in ms)authCredentials
- to connect to withnull
for Default System User- Returns:
- any results from the invocation
- Throws:
WSClientException
- Note, if you aren't reusing a session, then the cache won't be availableIMyWebService myWebService = (IMyWebService)WSClient.getProxy(IMyWebService.class, wsdlURL, endPointURL); Object results = myWebService.runWebService(myParams);
-
getProxy
public IWSClientProxy getProxy(Class<?> clazz, String wsdlURL, String[] mapURLs, String endPointURL, boolean useCache, boolean reuseSession, int socketTimeout, AuthCredentials authCredentials) throws WSClientException Description copied from interface:IWSProxyFactory
This will obtain a Proxy that can be used for invoking the target webService- Specified by:
getProxy
in interfaceIWSProxyFactory
- Parameters:
clazz
- the interface of the target webServicewsdlURL
- the location of the wsdl describing the webServicemapURLs
- String array of URLs describing the location of any associated map filesendPointURL
- the endpoint of the webServiceuseCache
- whether to use results from the cache if presentreuseSession
- if a previous session is available for the specified user, whether to reuse itsocketTimeout
- timeout for socket connections (in ms)authCredentials
- to connect to withnull
for Default System User- Returns:
- any results from the invocation
- Throws:
WSClientException
- Note, if you aren't reusing a session, then the cache won't be available Note, if the wsdl or map URLs specify the custom protocol 'classpath:', the file will be extracted from the classpath and stored as a local file in a temp subdirectory.IMyWebService myWebService = (IMyWebService)WSClient.getProxy(IMyWebService.class, wsdlURL, endPointURL); Object results = myWebService.runWebService(myParams);
-
getSocketTimeout
public int getSocketTimeout()Description copied from interface:IWSProxyFactory
Get the default socket timeout. This is the number of milliseconds the web service request will wait before it gives up waiting for a response from the web service provider. This value is set on theIWSClientProxy
created byIWSProxyFactory.getProxy(Class, String, String[], String, boolean, boolean, int, AuthCredentials)
- Specified by:
getSocketTimeout
in interfaceIWSProxyFactory
- Returns:
- the socket timeout value in milliseconds
-
setSocketTimeout
public void setSocketTimeout(int socketTimeout) Description copied from interface:IWSProxyFactory
Set the default socket timeout. This is the number of milliseconds the web service request will wait before it gives up waiting for a response from the web service provider. This value is set on theIWSClientProxy
created byIWSProxyFactory.getProxy(Class, String, String[], String, boolean, boolean, int, AuthCredentials)
- Specified by:
setSocketTimeout
in interfaceIWSProxyFactory
-
setCacheTimeout
public void setCacheTimeout(long ms) Description copied from interface:IWSProxyFactory
Hint for theIWSCacheManager
Sets the time-to-live for items in the web service results cache- Specified by:
setCacheTimeout
in interfaceIWSProxyFactory
-
getCacheTimeout
public long getCacheTimeout()Description copied from interface:IWSProxyFactory
Hint for theIWSCacheManager
Get the time-to-live of cached web service results. If caching is enabled, any cache entries older than this timeout value are considered stale.- Specified by:
getCacheTimeout
in interfaceIWSProxyFactory
- Returns:
- the cache entry time-to-live, measured in milliseconds
-
getCacheCapacity
public int getCacheCapacity()Description copied from interface:IWSProxyFactory
Hint for theIWSCacheManager
- Specified by:
getCacheCapacity
in interfaceIWSProxyFactory
- Returns:
- get the current maximum capacity of the web service results cache
-
setCacheCapacity
public void setCacheCapacity(int capacity) Description copied from interface:IWSProxyFactory
Hint for theIWSCacheManager
Set the initial capacity of the web service results cache- Specified by:
setCacheCapacity
in interfaceIWSProxyFactory
-