HTTP adapter request and response for a GET action
The HTTP adapter can retrieve data from a specified URL by using a GET action. You must enter the GET action in the Action field of the Properties tab for the Call Adapter activity. When you use a context item as an input for an adapter request, you must enclose the adapter request in the <request-data> elements. However, when you create a static request, <request-data> is not required and the adapter request starts with the <adapterName-adapter-request> element.
The following table describes the adapter request elements for the HTTP adapter with a GET action.
Elements for an HTTP adapter request with a GET action
Element | Description | Required |
---|---|---|
<action> | Specifies the URL for the target page | Yes |
<use-ssl-certificate> | Determines whether to establish a secure connection | No |
<allow-unsigned-certificate> | Specifies whether to allow unsigned certificates from trusted zones | No |
<install-certificate> | Determines whether to install certificates | No |
<passphrase> | Specifies the Java Standard Trust Keystore passphrase Verify the cacerts passphrase using the following command in UNIX or Linux: | No |
<data-format> | Indicates the data type for the adapter response | No |
<data> | Contains the information to be sent You can send this information in one of the following formats:
| No |
<http-connection-properties> | Specifies an XML document that includes HTTP connection properties, which contain the <user-name> and <password> elements for authentication The HTTP adapter supports basic, NTLM v1 and NTLMv2, and Kerberos authentication. The <http-connection-properties> element allows you to specify the standard header fields for an HTTP action. For example, <http-connection-properties> <data-format>XML</data-format> <kerberos-authentication>true</kerberos-authentication> <user-name>kerberosuser@BAO-DV12.LOCAL</user-name> <password>password</password> </http-connection-properties> Note: The user name and password properties are not set in the request header and are case sensitive. | No |
<user-name> | Specifies the user name required for basic or NTLM authentication specified in <http-connection-properties> | No |
<password> | Specifies the password corresponding to the user name specified in<http-connection-properties> | No |
<ntlm-authentication> | Indicates whether to use NTLM authentication for the target server for the specified user credentials Note: Specify <ntlm-authentication> as a child element of the <http-connection-properties> element. | No |
<Content-Type> | Specifies the type of data format for HTTP content | No |
<character-set> | Specifies the supporting CharSet | No |
<signature-properties> | Contains the elements that specify information about the public key (X.509 certificate) and the private key that are used for the digital signature
| No |
<keystore-file> | Specifies the path to the JKS that contains the client certificate | Conditional; required when<signature-properties mode="keystore"> |
<key-password> | Specifies the password of the key contained in the JKS | No |
<keystore-password> | Specifies the password to the JKS | Conditional; required when<signature-properties mode="keystore"> |
<alias> | Specifies the name of the alias in the JKS that identifies the Public Key Certificate (PKC) that the web server uses to authenticate the client | Conditional; required when<signature-properties mode="keystore"> |
<private-key-file> | Specifies the file containing the private key that is used to sign the HTTP request
| Conditional; required when<signature-properties mode="key-files"> |
<certificate-file> | Specifies the file containing the public key (X509 Certificate)
| Conditional; required when<signature-properties mode="key-files"> |
<private-key-data> | Contains an XML file specifying the private key in an Base64-encoded PEM format | Conditional; required when<signature-properties mode="key-data"> |
<certificate-data> | Contains an XML file specifying the public key (X509 Certificate) in an Base64-encoded PEM format | Conditional; required when<signature-properties mode="key-data"> |
<enable-json-conversion> | Specifies whether the adapter should treat the input data in the request and the data received in the adapter response as a JavaScript Object Notation (JSON) string
| No |
<enable-redirects> | Specifies whether the adapter should redirect a URL request to the changed URL location | No |
<download-attachment> | Specifies whether the adapter should display the content of the attached file in the adapter response or save the content in a file | No |
<download-directory> | Specifies the full path where the attached file must be downloaded | No |
<request-timeout> | Specifies the time (in seconds) to wait when establishing a connection | No |
<ignore-line-break-in-response> | Specifies whether to ignore the line breaks while generating the adapter response If true, the line break markups are ignored and the response is returned as a single line. If false, the line break markers (if specified in the adapter response) are retained. Valid values: true (default), false | No |
<kerberos-authentication> | Specifies whether to enable kerberos authentication for the HTTP adapter Valid values: true, false | No |
<krb-login-conf-path> | Specifies the location where the java login configuration file is placed on the Kerberos server For example, /opt/.java.login.conf If <krb-use-subject-creds> is set to true, a KrbLogin module must be specified in the java login configuration file. Example of a KrbLogin module com.sun.security.jgss.krb5.initiate { com.sun.security.auth.module.Krb5LoginModule required principal="your_username@YOUR_REALM" useTicketCache=true ticketCache="/path/to/your/krb5cc" doNotPrompt=true debug=true; } | Conditional; required if you use Kerberos authentication for the target server |
<krb-conf-path> | Specifies the location where the configuration file is placed on the Kerberos server | Conditional; required if you use Kerberos authentication for the target server |
<krb-use-subject-creds> | Specifies whether to use the user credentials for the Kerberos KDC server Valid values: true, false If true, specify <user-name> and <password> in the <http-connection-properties>, which serves as the HTTP header in the adapter request. For example, <http-connection-properties> <data-format>XML</data-format> <kerberos-authentication>true</kerberos-authentication> <user-name>kerberosuser@BAO-DV12.LOCAL</user-name> <password>password</password> </http-connection-properties> For adapter request and responses for Kerberos authentication, see Sample adapter request and response for the Kerberos authentication. | No |
<krb-debug> | Specifies whether to enable debugging mode for the request Valid value: true, false | No |
The HTTP adapter generates a response to the HTTP request (URL) defined in the adapter request.
The following table describes the elements of the response to an HTTP adapter request with a GET action, when<data-format> is HTML for any <Content-Type> of HTTP server response.
Elements of an HTTP adapter response to a request with a GET action when <data-format> is HTML for any <Content-Type> of HTTP response
Element | Description |
---|---|
<status> | Specifies the status of the adapter request |
<metadata> | Contains the <status> element |
<status-line> | Contains the <code> and <reason> elements |
<code> | Specifies the numeric status code for the response |
<reason> | Specifies the reason associated with the status code |
<header-lines> | Contains the <field-name> element |
<field-name> | Specifies the field name returned from the adapter request in the HTTP header data |
<message-body> | Contains the message body of the HTTP response in text format |
Elements of an HTTP adapter response to a request with a GET action when <data-format> is XHTML or XML and <Content-Type> is a well-formed text, HTML, or XML
Element | Description |
---|---|
<status-line> | Contains the <code> and <reason> elements |
<code> | Specifies the numeric status code of a response |
<reason> | Specifies the reason associated with the status code |
<header-lines> | Contains the <field-name> element |
<field-name> | Specifies the field name returned from the adapter request |
<message-body> | Contains the message body of the HTTP response in XML format or uncorrected HTML format, not in character data (CDATA) format |
The following figure shows the sample adapter request when the HTTP adapter supports kerberos authentication.
Sample adapter request when the HTTP adapter supports Kerberos authentication
<use-ssl-certificate>true</use-ssl-certificate>
<character-set>UTF-8</character-set>
<install-certificate>true</install-certificate>
<action>http://vl-hou-atm-qa25.bmc.com:8080/spnego-demo/user/</action>
<allow-unsigned-certificate>true</allow-unsigned-certificate>
<data-format>XML</data-format>
<strip-namespace-from-response>true</strip-namespace-from-response>
<krb-login-conf-path>/opt/.java.login.conf</krb-login-conf-path>
<krb-conf-path>/opt/.krb5.conf</krb-conf-path>
<krb-use-subject-creds>true</krb-use-subject-creds>
<krb-debug>false</krb-debug>
<http-connection-properties>
<data-format>XML</data-format>
<kerberos-authentication>true</kerberos-authentication>
<user-name>kerberosuser@BAO-1234.LOCAL</user-name>
<password>password</password>
</http-connection-properties>
</http-adapter-request>
The following figure shows the adapter response when the adapter supports Kerberos authentication.
Adapter response when the adapter supports Kerberos authentication
<metadata>
<status>success</status>
</metadata>
<status-line>
<code>200</code>
<reason>OK</reason>
</status-line>
<header-lines>
<Expires>0</Expires>
<Cache-Control>no-cache, no-store, must-revalidate</Cache-Control>
<X-Powered-By>Undertow/1</X-Powered-By>
<X-Powered-By>JSP/2.3</X-Powered-By>
<Set-Cookie>JSESSIONID=Tm1eqPVlGyiFhVzAR6kBgs2RqbB1-jSTNMQBLgnc.vl-hou-atm-qa25;
path=/spnego-demo</Set-Cookie>
<Server>WildFly/10</Server>
<Pragma>no-cache</Pragma>
<Date>Mon, 12 Jun 2017 05:49:16 GMT</Date>
<Connection>keep-alive</Connection>
<WWW-Authenticate>Negotiate oW4wbKJqBGhgZgYJKoZIhvcSAQICAgBvVzBVoAMCAQWhAwIBD6JJMEegAwIB
F6JABD6R1sYjZE5eZ1GLmewnaiauwsrr8G/mzEGmMlRBHqwQ0haVi
/TokvoUYwumKJ0GmK/Ya6M78C3bY8qA/DYkKQ==</WWW-Authenticate>
<Content-Type>text/html;charset=utf-8</Content-Type>
<Content-Length>1292</Content-Length>
</header-lines>
<message-body>
<html>
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org" />
<title>Sample secured web application</title>
</head>
<body>
<page content>
</body>
</html>
</message-body>
</httpAdapterResponse>