This is the documentation for the development version. There are no official binaries for it; build it from the source code in git. Download links on these pages work only after the release. For the current release, see version 7.0.

WebServiceResponse

Contains all information about web service custom request execution result

Instance attributes

agentErrorCode: int

Agent error code (0 if the agent completed the request)

body: String

Response body. Alias for document.

document: String

Document that was returned by web service as a response to the request. For HTTP error responses and unfollowed redirects, contains the response body.

errorMessage: String

Human readable error message set by server or agent (empty string if there is no error)

headers: HashMap

Headers of the final response (after followed redirects) as hash map. Header names are converted to lower case; values of repeated headers are joined with comma. null if the agent does not report response headers (agents older than the server).

httpResponseCode: int

HTTP response code

redirectUrl: String

Target URL of an HTTP redirect that was not followed (following redirects is disabled in the web service definition, or redirect limit reached), or null if the response was not a redirect.

statusCode: int

HTTP response status code. Alias for httpResponseCode.

success: bool

true if the agent completed the request and received an HTTP response, false if there was a problem on server or on agent (no connection, timeout, communication failure). HTTP error responses (4xx, 5xx) and unfollowed redirects are reported with success set to true; check statusCode.

Instance methods

getHeader(name): String

Get response header value. Header name is matched case-insensitively.

Table 1. Parameters

name

String

Header name.

Return

Header value, or null if the header is not present or the agent does not report response headers.

result = $node.getWebService("webSvcName").get();
println("Content type: " .. result.getHeader("Content-Type"));