This class does not have a constructor, so you cannot create it directly.
To get an instance of this class, use one of the subclass constructors.
getResponse()
:
Object
Returns the property that stores the object returned by the service.
getURL()
:
String
Returns the current URL, excluding any custom query parameters.
isMock()
:
boolean
Returns the status of whether this service is executing in mock mode.
isThrowOnError()
:
boolean
Returns the status of whether this service will throw an error when encountering a problem.
setThrowOnError()
:
Service
Forces a Service to throw an error when there is a problem instead of returning a Result with non-OK status.
call
Invokes the service.
Parameters:
args
-
Arguments to pass. If there is a single argument and that argument is an array, then each item in the array will become a separate argument. For example, the following results in three separate arguments to the service: svc.call( [1,2,3] )
and is functionally equivalent to svc.call( 1, 2, 3 )
This can be avoided by explicitly forming a List, enclosing the array in another array, or by sending a second argument. The following will all send the array as a List in the first argument. svc.call( ArrayList([1,2,3]) )
svc.call( [[1,2,3]] )
svc.call( [1,2,3], "" )
Another option is to change the definition of the associated ServiceCallback.createRequest(Service, Object...) to accept an object instead, and pass the array as a field of that object: svc.call( { 'data': [1,2,3] } )
Returns:
Result of the service.
getConfiguration
Returns the Service Configuration.
Returns:
Service Configuration.
getCredentialID
Returns the ID of the currently associated Credential.
Returns:
Credential Name.
getRequestData
Returns the property that stores the object returned by createRequest.
Returns:
Object returned by createRequest.
getResponse
Returns the property that stores the object returned by the service.
This property is only useful after the service call(Object...) completes, and is the same as the object
inside the Result.
Returns:
Object returned by the service.
getURL
Returns the current URL, excluding any custom query parameters.
isMock
isMock()
:
boolean
Returns the status of whether this service is executing in mock mode.
Returns:
true for mock mode, false otherwise.
isThrowOnError
isThrowOnError()
:
boolean
Returns the status of whether this service will throw an error when encountering a problem.
Returns:
true to throw an error, false otherwise.
setCredentialID
Override the Credential by the credential object with the given ID.
If the URL is also overridden, that URL will continue to override the URL in this credential.
Parameters:
id
-
Credential ID. It must exist.
setMock
Forces the mock mode to be enabled.
setThrowOnError
Forces a Service to throw an error when there is a problem instead of returning a Result with non-OK status.
setURL
Override the URL to the given value. Any query parameters (if applicable) will be appended to this URL.
Parameters:
url
-
Force the URL to the given value.