SOAPService¶
This behavior pattern implements SOAP service client.
Behavior Pattern: SOAPServiceBehavior
Property Summary¶
Property | Description | Getter | Setter |
---|---|---|---|
Credential | The HTTP Basic Authentication Credentials (if any). | GetCredential | SetCredential |
Name | The name of the request operation | GetName | |
ProxyHost | Proxy host name. | GetProxyHost | SetProxyHost |
ProxyPort | Proxy port number. | GetProxyPort | SetProxyPort |
ProxyPwd | Proxy password. | GetProxyPwd | SetProxyPwd |
ProxyUser | Proxy user name. | GetProxyUser | SetProxyUser |
ResponseBodyObject | The body of the HTTP response deserialized from SOAP into a JavaScript object. | GetResponseBodyObject | |
ResponseBodyText | The body of the HTTP response in raw text format. | GetResponseBodyText | |
ResponseHeaders | Returns the list of HTTP headers returned with the HTTP response. | GetResponseHeaders | |
ResponseIsErrorStatus | Returns 'true 'if an HTTP error code came back from the web service. | GetResponseIsErrorStatus | |
Url | The URL being used to access the web service. | GetUrl | SetUrl |
Action Summary¶
Action | Description |
---|---|
DoExecute | Executes a SOAP service operation, substituting any of the provided parameter values if necessary. |
DoExecuteRaw | Sends a SOAP request as is. |
DoRemoveParameter | Remove one pre-defined parameter. |
DoRemoveRequestHeader | Remove one pre-defined request header by name. |
DoSetProxy | Sets proxy for this request. |
DoVerify | Checks that a given part of response equals the expected value. |
Property Detail¶
Credential¶
The HTTP Basic Authentication Credentials (if any). Sample code:
var credential = {};
credential.UserName = "fredbloggs";
credential.Password = "MyPassword";
SeS("Operation_Name").SetCredential(credential);
Type: object
Accessors: GetCredential, SetCredential
value = SeS('SomeSOAPService').GetCredential()
SeS('SomeSOAPService').SetCredential(value, value2)
Name¶
The name of the request operation
Type: string
Accessors: GetName
value = SeS('SomeSOAPService').GetName()
ProxyHost¶
Proxy host name. Requires Rapise 8.1+.
Type: string
Accessors: GetProxyHost, SetProxyHost
value = SeS('SomeSOAPService').GetProxyHost()
SeS('SomeSOAPService').SetProxyHost(value)
ProxyPort¶
Proxy port number. Requires Rapise 8.1+.
Type: string
Accessors: GetProxyPort, SetProxyPort
value = SeS('SomeSOAPService').GetProxyPort()
SeS('SomeSOAPService').SetProxyPort(value)
ProxyPwd¶
Proxy password. Requires Rapise 8.1+.
Type: string
Accessors: GetProxyPwd, SetProxyPwd
value = SeS('SomeSOAPService').GetProxyPwd()
SeS('SomeSOAPService').SetProxyPwd(value)
ProxyUser¶
Proxy user name. Requires Rapise 8.1+.
Type: string
Accessors: GetProxyUser, SetProxyUser
value = SeS('SomeSOAPService').GetProxyUser()
SeS('SomeSOAPService').SetProxyUser(value)
ResponseBodyObject¶
The body of the HTTP response deserialized from SOAP into a JavaScript object.
Getter Parameters:
Name | Type | Description |
---|---|---|
jsonPath | string | Path to a sub-object within response object. E.g. 'Body.Connection_AuthenticateResult'. Optional, Default: "Body". |
info | object | Empty object that will receive error information if any. Access as info.error in a calling function. Optional. |
Type: object
Accessors: GetResponseBodyObject
value = SeS('SomeSOAPService').GetResponseBodyObject(jsonPath,info)
ResponseBodyText¶
The body of the HTTP response in raw text format.
Type: string
Accessors: GetResponseBodyText
value = SeS('SomeSOAPService').GetResponseBodyText()
ResponseHeaders¶
Returns the list of HTTP headers returned with the HTTP response. Sample code:
var headers = SeS("Operation_Name").GetResponseHeaders();
for (var i = 0; i < headers.length; i++)
{
var name = headers[i].Name;
var value = headers[i].Value;
}
Type: object
Accessors: GetResponseHeaders
value = SeS('SomeSOAPService').GetResponseHeaders()
ResponseIsErrorStatus¶
Returns 'true 'if an HTTP error code came back from the web service.
Type: boolean
Accessors: GetResponseIsErrorStatus
value = SeS('SomeSOAPService').GetResponseIsErrorStatus()
Url¶
The URL being used to access the web service.
Type: string
Accessors: GetUrl, SetUrl
value = SeS('SomeSOAPService').GetUrl()
SeS('SomeSOAPService').SetUrl(value)
Action Detail¶
DoExecute¶
Executes a SOAP service operation, substituting any of the provided parameter values if necessary.
SeS('SomeSOAPService').DoExecute(method, params, headers)
Parameters:
Name | Type | Description |
---|---|---|
method | string | Name of a SOAP method. |
params | object | JavaScript object {"name1": "value1", "name2": "value2" } . Parameter values that should be passed to the web service operation. |
headers | object | Array of header name/value pairs. |
Returns:
boolean: 'true' if success, 'false' otherwise.
DoExecuteRaw¶
Sends a SOAP request as is.
SeS('SomeSOAPService').DoExecuteRaw(method, body, params)
Parameters:
Name | Type | Description |
---|---|---|
method | string | Name of a SOAP method. |
body | string | SOAP xml string. |
params | object | JavaScript object {"name1": "value1", "name2": "value2" } . Parameter values that should be passed to the web service operation. |
Returns:
boolean: 'true' if success, 'false' otherwise.
DoRemoveParameter¶
Remove one pre-defined parameter. Requires Rapise 6.6+
SeS('SomeSOAPService').DoRemoveParameter(name)
Parameters:
Name | Type | Description |
---|---|---|
name | string | Parameter name |
DoRemoveRequestHeader¶
Remove one pre-defined request header by name. Requires Rapise 6.6+
SeS('SomeSOAPService').DoRemoveRequestHeader(name)
Parameters:
Name | Type | Description |
---|---|---|
name | string | Header name |
DoSetProxy¶
Sets proxy for this request. Requires Rapise 8.1+.
SeS('SomeSOAPService').DoSetProxy(host, port, user, pwd)
Parameters:
Name | Type | Description |
---|---|---|
host | string | Proxy host name or IP address. |
port | string | Proxy port. |
user | string | Proxy user name. Optional. |
pwd | string | Proxy password. Optional. |
DoVerify¶
Checks that a given part of response equals the expected value.
SeS('SomeSOAPService').DoVerify(msg, jsonPath, expectedValue)
Parameters:
Name | Type | Description |
---|---|---|
msg | string | Message to write into the report. |
jsonPath | string | Path to the given node in the response object to use as a root for comparison with the expected value. |
expectedValue | object | Expected value. |
Returns:
boolean: 'true' if success, 'false' otherwise.