Execute GET

Operation name

Execute GET

Function Overview

Execute HTTP GET method request.

Data Model

XML type.
For more details on output schema, refer to “Schema”.

Properties

For details on use of variables, refer to “Variables”.
Basic settings
Item name Required/Optional Use of variables Description Remarks
Name Required Not available Enter the name to show on the script canvas.  
Required settings
Item name Required/Optional Use of variables Description Remarks
Destination Required Not available Select a global resource.
For details about how to configure global resource, refer to “Global Resource Properties”.
  • [Add]:
    Add a new global resource.
  • [Edit list]:
    Global resource settings can be edited in “Edit resource list” screen.
 
Path Optional Available Specify a relative path from the URL entered in [URL] of [Destination].
  • lightbulbIt will be URL encoded using the encoding entered or selected in [Encoding].
Encoding Optional Available Select or enter an encoding used for URL encoding.

When you enter encoding, specify one of the encodings supported in Java SE Runtime Environment 8.
For more details, refer to “Supported Encodings” (http://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html).
  • Default value is “UTF-8” and it will be set when omitted.
Query parameter Optional - Specify names and values for query parameters to be linked with the URL.

Each query parameter can be operated with the following buttons.
  • [Add]:
    Add a query parameter.
  • [Up]:
    Move the selected query parameter upwards by one row.
  • [Down]:
    Move the selected query parameter downwards by one row.
  • [Delete]:
    Delete the query parameter.
  • lightbulbIt will be URL encoded using the encoding entered or selected in [Encoding].
Query parameter/Name Optional Available Enter the name of query parameter.
  • When omitted, the query parameter will not be concatenated to the URL.
Query parameter/Value Optional Available Enter the value of query parameter.  
Response settings
Item name Required/Optional Use of variables Description Remarks
Output destination Required Not available Select output destination of a response body.
  • [Data]: (default)
    Output to result data. Output in the format selected in [Data format].
  • [File]:
    Output to the file specified in [File path].
 
Data format Required Not available Select a data format of response body.
  • [XML]: (default)
    Process as XML format.
  • [JSON]:
    Process as JSON format.
  • [Other]:
    Process as text or binary format.
  • Displayed when [Data] is selected in [Output destination].
  • Output schema varies depending on the selected data format.
  • For more details on output schema, refer to “Output schema”.
File path Required Available Select or enter a file path of output destination for response body.

You can click [Browse] button to launch file chooser and find the file.
Remove invalid XML characters Optional Not available Select whether or not to remove invalid characters for XML automatically if that will be found while parsing JSON format data.
  • [Checked]:
    Invalid characters for XML will be removed.
  • [Not checked]: (default)
    Invalid characters for XML will not be removed.
  • Displayed when [JSON] is selected in [Data format].
Redirect automatically Optional Not available Select whether or not to redirect automatically when a redirect destination is included in the response.
  • [Checked]:
    Redirect automatically.
  • [Not checked]: (default)
    Do not redirect automatically.
Error when response status code is 4xx or 5xx Optional Not available Select whether or not to make the processing an error when the response status code is “4xx” or “5xx”.
  • [Checked]:
    Processing will be an error.
  • [Not checked]: (default)
    Processing will not be an error.
 
Property actions
Item name Description Remarks
Set schema with JSON file Specify a JSON file and set the output schema. Displayed when [JSON] is selected in [Data format].
Header settings
Item name Required/Optional Use of variables Description Remarks
Request header Optional - Specify HTTP headers to be included in a request.

Each request header can be operated with the following buttons.
  • [Add]:
    Add a request header.
  • [Up]:
    Move the selected request header upwards by one row.
  • [Down]:
    Move the selected request header downwards by one row.
  • [Delete]:
    Delete the request header.
 
Request header/Name Optional Available Enter the request header name.
  • When omitted, the request header is not included in request.
Request header/Value Optional Available Enter the request header value.  
Response header Optional - Specify header names to get from HTTP headers included in a response.

Each response header can be operated with the following buttons.
  • [Add]:
    Add a response header.
  • [Up]:
    Move the selected response header upwards by one row.
  • [Down]:
    Move the selected response header downwards by one row.
  • [Delete]:
    Delete the response header.
  • lightbulbA response header is defined as a component variable with the name entered in [Name].
Response header/Name Optional Only environment variables are available Enter the response header name.
  • Case-insensitive.
  • When omitted, it is not defined as a component variable.
  • When there is a space / tab / line feed before or after the name, it will be trimmed and defined as a component variable.
Authentication settings
Item name Required/Optional Use of variables Description Remarks
Authentication Required Not available Select authentication method on sending a request.
  • [None]: (default)
    Authentication will not be performed.
  • [Basic authentication]:
    Basic authentication will be performed.
  • [Digest authentication]:
    Digest authentication will be performed.
  • [WSSE authentication]:
    WSSE authentication will be performed.
  • [NTLM authentication]:
    NTLM authentication will be performed.
  • [Global resource]:
    Authentication using global resource will be performed.
    For more details on how to configure global resource, refer to the following.
 
User Optional Available Enter the user name used for authentication.
  • Displayed when [Basic authentication], [Digest authentication], [WSSE authentication], or [NTLM authentication] is selected in [Authentication].
Password Optional Available Enter the password used for authentication.
  • Displayed when [Basic authentication], [Digest authentication], [WSSE authentication], or [NTLM authentication] is selected in [Authentication].
Global resource Optional Not available Select a global resource used for authentication.
  • Displayed when [Global resource] is selected in [Authentication].
Data processing method
Item name Required/Optional Use of variables Description Remarks
Data processing method Optional Not available Select data processing method.
  • [Apply script settings]: (default)
    Apply the mass data processing settings of the script property to the adapter.
  • [Do not perform mass data processing]:
    Mass data processing will not be performed.
  • [Perform mass data processing]:
    Mass data processing will be performed.
 
Comment
Item name Required/Optional Use of variables Description Remarks
Comment Optional Not available You can write a short description of this adapter.
The description will be reflected in the specifications.
 

Schema

Input schema

None.

Output schema

The schema varies depending on [Data format] settings of [Response settings].

In the case of [XML]

The schema varies depending on XML data of the response body.

In the case of [JSON]

When the response body is JSON type data, the data is converted to XML and output to the result data.
The schema converted from JSON to XML is as follows.
<- When JSON object of which the root is object type ->
<?xml version="1.0"?>
<root type="object">
  <JSON member name type="attribute value showing JSON type">value</JSON member name>
    :
</root>

<-When JSON object of which the root is array type->
<?xml version="1.0"?>
<root type="array">
  <element type="attribute value showing JSON type">value</element>
    :
</root>

<--When JSON member name is invalid for XML element name -->
<?xml version="1.0"?>
<root type="object">
  <member type="attribute value showing JSON type" name="JSON member name">value</member>
    :
</root>
Element name Attribute name Description Remarks
root - Root element wrapping JSON object.  
type Attribute value showing JSON type is set.
Attribute value Description
object Shows JSON object type.

Example: A JSON object consists of object type
{"name":"Suzuki"}
The above JSON object is converted to XML data as follows and output.
<root type="object">
  <name type="string">Suzuki</name>
</root>
array Shows JSON array type.

Example: A JSON object consists of array type
["apple","grape”,"orange"]
The above JSON object is converted to XML data as follows and output.
<root type="array">
  <element type="string">apple</element>
  <element type="string">grape</element>
  <element type="string">orange</element>
</root>
 
JSON member name - Element that shows JSON member.  
type Attribute value showing JSON type is set.
Attribute value Description
string Shows JSON string type.

Example: A JSON member with string type value
{"name":"Suzuki"}
The above JSON member is converted to the following XML data and output.
<name type="string">Suzuki</name>
number Shows JSON numeric type.

Example: A JSON member with numeric type value
{"age":37}
The above JSON member is converted to the following XML data and output.
<age type="number">37</age>
boolean Shows JSON boolean type.

Example: A JSON member with boolean value
{"success":true}
The above JSON member is converted to the following XML data and output.
<success type="boolean">true</success>
object Shows JSON object type.

Example: A JSON member with object type value
{"name":{"first":"Ichiro","last":Suzuki"}}
The above JSON member is converted to the following XML data and output.
<name type="object">
  <first type="string">Ichiro</first>
  <last type="string">Suzuki</last>
</name>
array Shows JSON array type.

A JSON array type element is shown in “element” element.
When a JSON array type element is object type, an XML data with the schema that shows the JSON object is output to the child element of “element” element. When the type is other than that, the value will be output to the “element” element.

The schema is as follows.
<JSON member name type="array">
  <element type="attribute value showing JSON type">value</element>
    :
</JSON member name>

Example: A JSON member with array type value
{"fruits":["apple","grape","orange"]}
The above JSON member is converted to the following XML data and output.
<fruits type="array">
  <element type="string">apple</element>
  <element type="string">grape</element>
  <element type="string">orange</element>
</fruits>
null Shows JSON null type.

Example: A JSON member with null type value
{"name":null}
The above JSON member is converted to the following XML data and output.
<name type="null"/>
 
element - Element name that shows array element.  
type A string that shows JSON type is output.
The attribute value same as the type attribute of JSON member name is set.
 
member - Element name used when the JSON member name is invalid for XML element name.  
type A string that shows JSON type is output.
The attribute value same as the type attribute of JSON member name is set.
 
name A JSON member name is output.

Example: A JSON member with an invalid name for XML element name.
{"1name":"Suzuki"}
The above JSON member is converted to the following XML data and output.
<member type="string" name="1name">Suzuki</member>
 

In the case of [Other]

<?xml version="1.0"?>
<response>
  <body>
    <content>response body data</content>
  </body>
</response>
Element name Attribute name Description Remarks
response -    
body -    
content - Data of the response body. The data varies depending on the value of Content-Type header of the response.
  • When any of the following conditions is satisfied, the response body is considered as text data and the string output is encoded with the charset parameter value in the Content-Type header.
    • Type of the Content-Type header is "text".
    • The subtype of the Content-Type header ends with "xml" or "json".
  • When none of the above conditions is satisfied, the response body is considered as binary data. From that, byte array data will be generated based on the charset parameter value of the Content-Type header, then it will be converted into Base64 format, and output as string.
  • When there is no Content-Type header or charset parameter, "ISO-8859-1" is used by default.

Loading schema in Mapper

Loading schema varies depending on [Data format] of [Response settings].

In the case of [XML]

Schema should be loaded manually.
Specify the schema of the response body.

In the case of [JSON]

When using [Set schema with JSON file], the schema is loaded automatically.

In the case of [Other]

Schema is loaded automatically.
lightbulbYou can edit the loaded schema.
Refer to “Edit Schema” for more details.

Mass data processing

Mass Data Processing is supported.

Transaction

Transaction is not supported.

PSP Usage

PSP is not supported.

Available Component Variables

Component variable name Description Remarks
status_code HTTP status code of the response is stored.
  • Default value is null.
reason_phrase Text phrase related to the HTTP status code of the response is stored.
  • Default value is null.
error_response_body The response body with a response status code "4xx" or "5xx" is stored.
  • Default value is null.
message_category When an error occurs, the corresponding message code's category is stored.
  • Default value is null.
message_code When an error occurs, the corresponding message code is stored.
  • Default value is null.
message_level When an error occurs, the corresponding message code's severity is stored.
  • Default value is null.
error_type When an error occurs, the error type is stored.
  • Default value is null.
  • The error type will be in the following format.
    Example: “java.io.FileNotFoundException”
  • The contents that will be stored may vary depending on DataSpider Servista versions.
error_message When an error occurs, the error message is stored.
  • Default value is null.
  • The contents that will be stored may vary depending on DataSpider Servista versions.
error_trace When an error occurs, the error's trace information is stored.
  • Default value is null.
  • The contents that will be stored may vary depending on DataSpider Servista versions and client applications.

Auto Redirection

When [Redirect automatically] is checked, the behavior will be as follows.

The Result Data When the Response Status Code Is 400 or Higher

When the response status code is 400 or higher, the response body is output to the result data.
At that time, the schema of result data varies depending on the value of Content-Type header of the response.

Specification Limits

Major Exceptions

Exception name Cause Solution
ResourceNotFoundException
Resource definition is not found. Name: []
[Destination] is not specified. Specify [Destination].
ResourceNotFoundException
Resource definition is not found. Name: [<global resource name>]
The resource definition selected in [Destination] is not found. Check the global resource specified in [Destination].
InvalidPropertyConfigurationException
Required item of the resource is not specified. :<property name>
[<property name>] of [Destination] is not specified. Specify [<property name>] of [Destination].
InvalidPropertyConfigurationException
<property name> is not specified.
[<property name>] is not specified. Specify [<property name>].
FileIsDirectoryException The path entered in [File path] is directory. Enter a file path in [File path].
PathIsNotAbsoluteException The path entered in [Path] or [File path] is a relative path. Enter an absolute path in [Path] or [File Path].
RestServerException A response with status code “5xx” was returned from the HTTP server. Referring to the contents of error message, check the status of the HTTP server specified in [Destination] or the contents of the request.
RestClientException A response with status code “4xx” was returned from the HTTP server. Referring to the contents of error message, check the path entered in [Path] or the contents of the request.
org.apache.http.conn.HttpHostConnectException Unable to connect to the HTTP server or the proxy server. Check whether it is possible to connect to the destination HTTP server or the proxy server.
org.apache.http.conn.ConnectTimeoutException A timeout has occurred while connecting to the HTTP server or the proxy server. Check the setting of [Connection timeout] in [Destination].
java.net.SocketTimeoutException After connecting to the HTTP server and sending the request, a timeout has occurred before receiving the response. Check the setting of [Response timeout] of [Destination].
javax.json.stream.JsonParsingException An error occurred while processing the response body as JSON format. Referring to the contents of error message, check the settings of [Response settings] and the contents of the response.

Notes