|
|
addData(Data data)
Adds data to request body. Used if request body created from fragment
|
|
|
addDataList(DataList datalist)
Adds datalist to request body. Used if request body created from fragment
|
|
|
checkConnection(boolean enabled)
Enables DNS and certificate details (if any) to be gathered during the request and provided in Response.getConnectionInfo().
|
|
|
clearFormParameters()
Removes all for parameters set for this request
|
|
|
clearHeaders()
Removes all request headers set for this request
|
|
XMLReader
|
createServicePayload(Attachment attachment)
Creates an XMLReader from the contents of the attachment. This is primarily used for testing or re-analyzing a stored response. The attachment must be XML.
|
|
XMLReader
|
createServicePayload(File file)
Creates an XMLReader from the contents of the file. This is primarily used for testing or re-analyzing a stored response. The file must be XML.
|
|
|
echo(boolean enabled)
If enabled, this tells the ServiceRequest to bundle the request and submit to itself. Credentials are masked. This is used for troubleshooting requests so developers can analyze the payload and headers being sent.
|
|
Data
|
getFormParameters()
Returns a read-only copy of the form parameters for this request.
|
|
ServiceResponse
|
getLastResponse()
Returns last response for this request. This method returns null if the request wasn't submitted yet
|
|
String
|
resolveHost(String host)
Returns the resolved IP address of the host
|
|
|
setAWS(String accessKeyId, String secretAccessKey, String region, String service)
Configures this request for AWS authentication.
|
|
|
setAWSProvider(StorageProvider storageProvider, String service)
Configures this request for AWS authentication using credentials and region from the specified storage provider. Works only for AWS S3 provider settings.
|
|
|
setAttachment(String varName, Attachment attachment)
Adds the attachment. Content is set as base64
|
|
|
setAuthenticationPreemptive(boolean enabled)
Enables preemptive authentication mode. In this mode ServiceRequest will send the basic authentication even before the server gives an unauthorized response in certain situations, thus reducing the overhead of making the connection. This method has effect only if authentication is controlled by ServiceRequest (true by default), see setSendAuthorization()
|
|
|
setBasicAuthorization(String name, String password)
Sets basic authorization for this request. Note: this method has no effect if request submitted using connector settings
|
|
|
setBinaryBody(String base64)
Sets the request body given a base64 encoded string. It will decode the string to binary and set the request body. Automatically sets the content type to octet-stream.
|
|
|
setContentType(String contentType)
Sets content type of this request. Default value is application/xml
|
|
|
setCoreDocument(String varName, Document doc)
Adds the XML of the dta:Document element including all references. Content is set as base64.
|
|
|
setEncoding(String encoding)
Sets (or removes) the character encoding of the request. Default is UTF-8.
|
|
|
setFile(String varName, File file)
Adds the file. Content is set as base64
|
|
|
setFormParameter(String name, String value)
Sets request form parameter. Note: this method has no effect for POST and PUT methods if request body set from fragment or string
|
|
|
setFormParameters(Data data)
Sets request form parameters from data. Note: this method has no effect for POST and PUT methods if request body set from fragment or string
|
|
|
setFragment(Fragment fragment)
Set fragment of type "service request" as this request body
|
|
|
setFragmentFormParameter(String name, Fragment value)
Sets request form parameter from fragment. Note: this method has no effect for POST and PUT methods if request body set from fragment or string
|
|
|
setIgnoreStatusCodes(boolean ignore)
Allows to ignore http status code of response and use response body in error state. Useful for dealing with SOAP
|
|
|
setKeyStore(Data keystore, String password)
Configures this request to present a client certificate during the TLS handshake (mTLS). Note: this method has no effect if request submitted using connector settings.
|
|
|
setMethod(String method)
Sets http method for this request. Default is POST. Note that only POST and PUT methods will allow to send request body
|
|
|
setNTLMAuthorization(String name, String password, String domain)
Sets NTLM authorization for this request. Note: this method has no effect if request submitted using connector settings
|
|
|
setOauth(String privateKey, Data params)
Configures this request for OAuth authentication. Standard oauth parameters in the Data are used to construct the Authorization header. The platform will construct the minimum necessary and pass through any parameters not needing to be changed during signature calculations. Required data elements: oauth_consumer_secret (for hmac-sha1), oauth_consumer_key, and oauth_signature_method (should be rsa-sha1, hmac-sha1, or plaintext). You may also provide oauth_nonce and oauth_timestamp if desired (i.e. for testing) but these will be provided if not present.
|
|
|
setPacket(String varName, Packet packet)
Adds the XML of the entire transaction packet without a dsig wrapper. Content is set as base64
|
|
|
setPdfDocument(String varName, Document doc)
Adds the doc as a PDF. If the document is not already PDF it is converted to PDF. Content is set as base64.
|
|
|
setRequestBody(String body)
Sets free-form string request body. Useful for request with JSON body
|
|
|
setRequestHeader(String header, String value)
Adds request header or removes it if value is null
|
|
|
setSendAuthorization(boolean send)
Enables or disables sending HTTP authorization header if user and password specified. Allows to control authorization manually. Enabled by default.
|
|
|
setTimeout(int connectTimeout, int dataTimeout)
Sets the maximum timeout for the connection to (a) connect and (b) wait for data before terminating the connection. Default is 15 seconds for connect and 30 seconds for data.
|
|
|
sign(String signatureId, String key)
Completes the digital signature identified by signatureId.
|
|
ServiceResponse
|
submit(String url, boolean failOnSSLHandshake, boolean allowRedirect)
Submits request to specified url. failOnSSLError used for https connections. If failOnSSLError set to true request will fail if remote host certificate do not pass validation. allowRedirect=false is more secure and should be used if you know the remote service does not forward requests to a new location. Check response code and message.
|
|
ServiceResponse
|
submitUsingConnector(String connector)
Submits request using connector settings defined for enterprise
|
|
ServiceResponse
|
submitUsingConnector(String connector, String url)
Submits request using connector settings defined for enterprise. Allows to redefine url for submit. Url can be absolute or relative. Relative urls are appended to the connector url.
|
|
String
|
urlEncode(String value)
Performs URL-encoding of specified value
|
Method Detail
addData(Data data)
Adds data to request body. Used if request body created from fragment
Parameters:
Since:
12-22-2009
addDataList(DataList datalist)
Adds datalist to request body. Used if request body created from fragment
Parameters:
Since:
12-22-2009
checkConnection(boolean enabled)
Enables DNS and certificate details (if any) to be gathered during the request and provided in Response.getConnectionInfo().
Parameters:
Since:
07-12-2013
clearFormParameters()
Removes all for parameters set for this request
Since:
12-23-2009
clearHeaders()
Removes all request headers set for this request
Since:
12-23-2009
XMLReader createServicePayload(Attachment attachment)
Creates an XMLReader from the contents of the attachment. This is primarily used for testing or re-analyzing a stored response. The attachment must be XML.
Parameters:
Returns:
XMLReader
Since:
08-27-2010
XMLReader createServicePayload(File file)
Creates an XMLReader from the contents of the file. This is primarily used for testing or re-analyzing a stored response. The file must be XML.
Parameters:
-
File
file
Required parameter.
Returns:
XMLReader
Since:
08-27-2010
echo(boolean enabled)
If enabled, this tells the ServiceRequest to bundle the request and submit to itself. Credentials are masked. This is used for troubleshooting requests so developers can analyze the payload and headers being sent.
Parameters:
Since:
09-27-2010
Data getFormParameters()
Returns a read-only copy of the form parameters for this request.
Returns:
Data
Since:
06-16-2021
ServiceResponse getLastResponse()
Returns last response for this request. This method returns null if the request wasn't submitted yet
Returns:
ServiceResponse
Since:
12-22-2009
String resolveHost(String host)
Returns the resolved IP address of the host
Parameters:
Returns:
String
Since:
03-25-2016
setAWS(String accessKeyId, String secretAccessKey, String region, String service)
Configures this request for AWS authentication.
Parameters:
-
String
accessKeyId
- Access Key ID.
Required parameter.
-
String
secretAccessKey
- Secret Access Key.
Required parameter.
-
String
region
- Region, e.g. us-west-1.
Required parameter.
-
String
service
- Service, e.g. ec2.
Required parameter.
Since:
11-07-2016
setAWSProvider(StorageProvider storageProvider, String service)
Configures this request for AWS authentication using credentials and region from the specified storage provider. Works only for AWS S3 provider settings.
Parameters:
-
StorageProvider
storageProvider
Required parameter.
-
String
service
- Service, e.g. ec2.
Required parameter.
Since:
01-08-2020
setAttachment(String varName, Attachment attachment)
Adds the attachment. Content is set as base64
Parameters:
-
String
varName
- variable name.
Required parameter.
-
Attachment
attachment
Required parameter.
Since:
05-31-2010
setAuthenticationPreemptive(boolean enabled)
Enables preemptive authentication mode. In this mode ServiceRequest will send the basic authentication even before the server gives an unauthorized response in certain situations, thus reducing the overhead of making the connection. This method has effect only if authentication is controlled by ServiceRequest (true by default), see setSendAuthorization()
Parameters:
-
boolean
enabled
- enable or disable preemptive authentication.
Since:
08-25-2010
setBasicAuthorization(String name, String password)
Sets basic authorization for this request. Note: this method has no effect if request submitted using connector settings
Parameters:
-
String
name
-
String
password
Since:
12-22-2009
setBinaryBody(String base64)
Sets the request body given a base64 encoded string. It will decode the string to binary and set the request body. Automatically sets the content type to octet-stream.
Parameters:
-
String
base64
Required parameter.
Since:
01-27-2025
setContentType(String contentType)
Sets content type of this request. Default value is application/xml
Parameters:
Since:
12-22-2009
setCoreDocument(String varName, Document doc)
Adds the XML of the dta:Document element including all references. Content is set as base64.
Parameters:
-
String
varName
- variable name.
Required parameter.
-
Document
doc
Required parameter.
Since:
05-31-2010
setEncoding(String encoding)
Sets (or removes) the character encoding of the request. Default is UTF-8.
Parameters:
-
String
encoding
Maximum allowed size of parameter: 100
Since:
06-13-2013
setFile(String varName, File file)
Adds the file. Content is set as base64
Parameters:
-
String
varName
- variable name.
Required parameter.
-
File
file
Required parameter.
Since:
05-31-2010
setFormParameter(String name, String value)
Sets request form parameter. Note: this method has no effect for POST and PUT methods if request body set from fragment or string
Parameters:
Since:
12-23-2009
setFormParameters(Data data)
Sets request form parameters from data. Note: this method has no effect for POST and PUT methods if request body set from fragment or string
Parameters:
Since:
12-23-2009
setFragment(Fragment fragment)
Set fragment of type "service request" as this request body
Parameters:
Since:
12-22-2009
setFragmentFormParameter(String name, Fragment value)
Sets request form parameter from fragment. Note: this method has no effect for POST and PUT methods if request body set from fragment or string
Parameters:
Since:
12-23-2009
setIgnoreStatusCodes(boolean ignore)
Allows to ignore http status code of response and use response body in error state. Useful for dealing with SOAP
Parameters:
Since:
02-01-2010
setKeyStore(Data keystore, String password)
Configures this request to present a client certificate during the TLS handshake (mTLS). Note: this method has no effect if request submitted using connector settings.
Parameters:
-
Data
keystore
- Data returned by EncryptionUtil.createKeyStore() (or equivalently shaped Data with a 'keystore' field containing Base64 PKCS12 bytes)..
Required parameter.
-
String
password
- Password used to encrypt the PKCS12 store..
Required parameter.
Since:
07-22-2026
setMethod(String method)
Sets http method for this request. Default is POST. Note that only POST and PUT methods will allow to send request body
Parameters:
Since:
12-22-2009
setNTLMAuthorization(String name, String password, String domain)
Sets NTLM authorization for this request. Note: this method has no effect if request submitted using connector settings
Parameters:
-
String
name
-
String
password
-
String
domain
Since:
12-22-2009
setOauth(String privateKey, Data params)
Configures this request for OAuth authentication. Standard oauth parameters in the Data are used to construct the Authorization header. The platform will construct the minimum necessary and pass through any parameters not needing to be changed during signature calculations. Required data elements: oauth_consumer_secret (for hmac-sha1), oauth_consumer_key, and oauth_signature_method (should be rsa-sha1, hmac-sha1, or plaintext). You may also provide oauth_nonce and oauth_timestamp if desired (i.e. for testing) but these will be provided if not present.
Parameters:
-
String
privateKey
- Base64 encoded private key, required if oauth_signature_method is rsa-sha1.
-
Data
params
Since:
01-13-2015
setPacket(String varName, Packet packet)
Adds the XML of the entire transaction packet without a dsig wrapper. Content is set as base64
Parameters:
-
String
varName
- variable name.
Required parameter.
-
Packet
packet
Required parameter.
Since:
05-31-2010
setPdfDocument(String varName, Document doc)
Adds the doc as a PDF. If the document is not already PDF it is converted to PDF. Content is set as base64.
Parameters:
-
String
varName
- variable name.
Required parameter.
-
Document
doc
Required parameter.
Since:
05-31-2010
setRequestBody(String body)
Sets free-form string request body. Useful for request with JSON body
Parameters:
Since:
12-22-2009
setRequestHeader(String header, String value)
Adds request header or removes it if value is null
Parameters:
-
String
header
Required parameter.
-
String
value
Since:
12-22-2009
setSendAuthorization(boolean send)
Enables or disables sending HTTP authorization header if user and password specified. Allows to control authorization manually. Enabled by default.
Parameters:
-
boolean
send
- enable or disable auth header. True by default.
Since:
06-09-2010
setTimeout(int connectTimeout, int dataTimeout)
Sets the maximum timeout for the connection to (a) connect and (b) wait for data before terminating the connection. Default is 15 seconds for connect and 30 seconds for data.
Parameters:
-
int
connectTimeout
Maximum allowed size of parameter: 30
-
int
dataTimeout
Maximum allowed size of parameter: 300
Since:
07-24-2013
sign(String signatureId, String key)
Completes the digital signature identified by signatureId.
Parameters:
-
String
signatureId
Required parameter.
-
String
key
- base64 encoded key.
Required parameter.
Since:
03-21-2013
ServiceResponse submit(String url, boolean failOnSSLHandshake, boolean allowRedirect)
Submits request to specified url. failOnSSLError used for https connections. If failOnSSLError set to true request will fail if remote host certificate do not pass validation. allowRedirect=false is more secure and should be used if you know the remote service does not forward requests to a new location. Check response code and message.
Parameters:
-
String
url
Required parameter.
-
boolean
failOnSSLHandshake
-
boolean
allowRedirect
Returns:
ServiceResponse
Since:
10-08-2015
ServiceResponse submitUsingConnector(String connector)
Submits request using connector settings defined for enterprise
Parameters:
Returns:
ServiceResponse
Since:
12-22-2009
ServiceResponse submitUsingConnector(String connector, String url)
Submits request using connector settings defined for enterprise. Allows to redefine url for submit. Url can be absolute or relative. Relative urls are appended to the connector url.
Parameters:
-
String
connector
- name of http(s) connector.
Required parameter.
-
String
url
- url for submit. If null or empty string specified then url from connector will be used.
Returns:
ServiceResponse
Since:
07-21-2010
String urlEncode(String value)
Performs URL-encoding of specified value
Parameters:
Returns:
String
Since:
12-22-2009