HTTP adapter request and response for a Post action
The Post operation sends data to a specified URL. The adapter request with a Post action uses the following formats:
- Single element
- Parent and child
- Entry, key-value
When you use a context item as an input for an adapter request, you must enclose the adapter request in <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.
BMC recommends that you do not include empty elements in the adapter request because they might cause errors.
The following table describes the elements of an HTTP adapter request with a Post action:
Elements of an HTTP adapter request with a Post action
The following figure shows an XML sample of the HTTP adapter request with a Post action and in the single element format, which uses a single <data> element to contain the data to be posted. Use the adapter request XML when you create a custom process by using the Call Adapter activity in BMC Atrium Orchestrator Development Studio.
XML sample of an HTTP adapter request with a Post action in single element format
<httpAdapterRequest>
<http-connection-properties/>
<action>http://10.128.249.21:8080/httpclientoperations/HttpClientServlet
</action>
<use-ssl-certificate>false</use-ssl-certificate>
<install-certificate>false</install-certificate>
<allow-unsigned-certificate>false</allow-unsigned-certificate>
<passphrase>changeit</passphrase>
<character-set>shift_jis</character-set>
<data>This is the sample String.</data>
</httpAdapterRequest>
The following figure shows an XML sample of an HTTP adapter request with a Post action and in the parent and child format, which uses a parent or a child method for containing data, with a single < parent> element inside the <data> element and an unlimited number of < child> elements of that parent. Use the adapter request XML when you create a custom process by using the Call Adapter activity in BMC Atrium Orchestrator Development Studio.
XML sample of an HTTP adapter request with a Post action in parent and child format
<httpAdapterRequest>
<http-connection-properties>
<ntlm-authentication>true</ntlm-authentication>
<http-connection-properties/>
<action>http://10.128.249.21:8080/httpclientoperations/HttpClientServlet
</action>
<use-ssl-certificate>false</use-ssl-certificate>
<install-certificate>false</install-certificate>
<allow-unsigned-certificate>false</allow-unsigned-certificate>
<passphrase>changeit</passphrase>
<character-set>shift_jis</character-set>
<data>
<parent>
<child1>Child 1 Data</child1>
<child2>Child 2 Data</child2>
</parent>
</data>
</httpAdapterRequest>
The following figure shows an XML sample of the HTTP adapter request with Post action in entry, key-value pair tags format that uses a key or value method. With this option, the <data> element contains one or more <entry> elements. Each <entry> element contains a <key> and <value> element. The <value> element can be a simple value or an XML document. Use the adapter request XML when you create a custom process by using the Call Adapter activity in BMC Atrium Orchestrator Development Studio.
HTTP adapter request with a Post action in entry and key-value format
<httpAdapterRequest>
<action>https://${Https_RemoteMachine}:${httpsPort}/HttpTestApp//EchoServlet
</action>
<use-ssl-certificate>true</use-ssl-certificate>
<install-certificate>true</install-certificate>
<allow-unsigned-certificate>true</allow-unsigned-certificate>
<character-set>shift_jis</character-set>
<data-format>xhtml</data-format>
<data>
<entry>
<key>Name</key>
<value>
<foo>
<bar>1</bar>
<bar>2</bar>
</foo>
</value>
</entry>
<entry>
<key>Credit Card</key>
<value>1234</value>
</entry>
<entry>
<key>Debit Card</key>
<value>12345</value>
</entry>
</data>
<http-connection-properties>
<user-name>admin</user-name>
<password>admin123</password>
</http-connection-properties>
</httpAdapterRequest>
The following figure shows an XML sample for the HTTP adapter request when the adapter supports mutual authentication.
XML sample of the HTTP adapter request when the adapter supports mutual authentication
<httpAdapterRequest>
<use-ssl-certificate>true</use-ssl-certificate>
<install-certificate>true</install-certificate>
<signature-properties>
<keystore-file>server.jks</keystore-file>
<keystore-password>changeit</keystore-password>
<alias>1</alias>
</signature-properties>
<action>https://10.128.249.45:8087/</action>
</httpAdapterRequest>
The following figure shows an XML sample for the HTTP adapter request with JSON data support.
XML sample of the HTTP adapter request with JSON data support
<httpAdapterRequest>
<use-ssl-certificate>false</use-ssl-certificate>
<install-certificate>true</install-certificate>
<allow-unsigned-certificate>true</allow-unsigned-certificate>
<enable-json-conversion>true</enable-json-conversion>
<data-format>xml</data-format>
<strip-namespace-from-response>true</strip-namespace-from-response>
<action>http://10.128.249.29:8089/</action>
</httpAdapterRequest>
The following figure shows an XML sample for the HTTP adapter request when <enable-redirects> is set to true.
XML sample for the HTTP adapter request when <enable-redirects> is set to true
<http-adapter-request>
<http-connection-properties>
<User-Agent>BMC Atrium Orchestrator</User-Agent>
</http-connection-properties>
<action>http://mail.google.com/mail/</action>
<use-ssl-certificate>false</use-ssl-certificate>
<install-certificate>false</install-certificate>
<allow-unsigned-certificate>true</allow-unsigned-certificate>
<passphrase>changeit</passphrase>
<data-format>html</data-format>
<data>
<data>
<entry>
<key>Email</key>
<value>somename@gmail.com</value>
</entry>
<entry>
<key>Passwd</key>
<value>_Mypassword_</value>
</entry>
</data>
</data>
<enable-redirects>true</enable-redirects>
</http-adapter-request>
The following figure shows an XML sample for the HTTP adapter request when <enable-redirects> is set to false.
XML sample for the HTTP adapter request when <enable-redirects> is set to false
<http-adapter-request>
<http-connection-properties>
<User-Agent>BMC Atrium Orchestrator</User-Agent>
</http-connection-properties>
<action>http://mail.google.com/mail/</action>
<use-ssl-certificate>false</use-ssl-certificate>
<install-certificate>false</install-certificate>
<allow-unsigned-certificate>true</allow-unsigned-certificate>
<passphrase>changeit</passphrase>
<data-format>html</data-format>
<data>
<data>
<entry>
<key>Email</key>
<value>somename@gmail.com</value>
</entry>
<entry>
<key>Passwd</key>
<value>_MyPassword_</value>
</entry>
</data>
</data>
<enable-redirects>false</enable-redirects>
</http-adapter-request>
The following figure shows an XML sample for the HTTP adapter request when the adapter supports uploading files for a Post action
XML sample for the HTTP adapter request when the adapter supports uploading files for a Post action
<httpAdapterRequest>
<action>http://localhost:6080/baorepo/resources</action>
<file-path>C:\bmc-workspace\ao\rel\20.11.03.00-R\adapters\adapter-http\target\aroar\ro-adapter-http_20.11.03.00.aroar</file-path>
<file-content-type>application/java-archive</file-content-type>
<data-format>XML</data-format>
<http-connection-properties>
<Authorization>Basic YWRtaW46YWRtaW4xMjM=</Authorization>
<Content-Type>application/java-archive</Content-Type>
<Resource-Type>ADAPTER</Resource-Type>
<Slug>ro-adapter-http_20.11.03.00.aroar</Slug>
</http-connection-properties>
</httpAdapterRequest>
The HTTP adapter generates a response to the HTTP request (URL) defined in the adapter request. The response format depends on <Content-Type> of the HTTP server response.
The following figure shows an XML sample for the HTTP adapter response with Post action in simple text data format.
XML sample of the HTTP adapter response with Post action for simple text data format
<httpAdapterResponse>
<metadata>
<status>success</status>
</metadata>
<status-line>
<code>200</code>
<reason>OK</reason>
</status-line>
<header-lines>
<Server>Apache-Coyote/1.1</Server>
<Content-Type>text/plain;charset=ISO-8859-1</Content-Type>
<Content-Length>391</Content-Length>
<Date>Mon, 05 Apr 2010 09:32:22 GMT</Date>
</header-lines>
<message-body>
<Html>
<Title>Testing Application for HTTP Adapter</Title>
<Head></Head>
<Title>Testing Application for HTTP Adapter</Title>
<Head></Head>
<Body>Hi, I am inside the doPost() Method of the EchoServlet,
<br><br><br><br> <br><br>
Query String : null<br><br><BR><BR>
XML Text : This is the sample String.
<Center> Copyrights ©, Developed By Test User </Center>
</Body>
</Html>
</message-body>
</httpAdapterResponse>
The following figure shows the XML sample for HTTP adapter response with Post action in parent-child format.
XML sample of the HTTP adapter response with a Post action in parent-child format
<httpAdapterResponse>
<metadata>
<status>success</status>
</metadata>
<status-line>
<code>200</code>
<reason>OK</reason>
</status-line>
<header-lines>
<Server>Apache-Coyote/1.1</Server>
<Content-Type>text/plain;charset=ISO-8859-1</Content-Type>
<Content-Length>444</Content-Length>
<Date>Mon, 05 Apr 2010 09:33:50 GMT</Date>
</header-lines>
<message-body>
<Html>
<Title>Testing Application for HTTP Adapter</Title>
<Head></Head>
<Title>Testing Application for HTTP Adapter</Title>
<Head></Head>
<Body>Hi, I am inside the doPost() Method of the EchoServlet,
<br><br>
<br><br>
<br><br> Query String : null
<br><br><BR><BR>
XML Text :
<parent>
<child1>Child 1 Data</child1>
<child2>Child 2 Data</child2>
</parent>
<Center> Copyrights ©, Developed By Test User </Center>
</Body>
</Html>
</message-body>
</httpAdapterResponse>
The following table describes the elements of an HTTP adapter response to a request with a Post action in entry, key-value pair tags format:
Elements of an HTTP adapter response to a request with a Post action for entry and key-value pair tags format
The following figure shows an XML sample for HTTP adapter response with a Post action in entry, key-value pair tags format.
XML sample of the HTTP adapter response with a Post action for entry and key-value pair tags format
<httpAdapterResponse>
<metadata>
<status>success</status>
</metadata>
<status-line>
<code>200</code>
<reason>OK</reason>
</status-line>
<header-lines>
<Server>Apache-Coyote/1.1</Server>
<Content-Type>text/plain;charset=ISO-8859-1</Content-Type>
<Content-Length>385</Content-Length>
<Date>Mon, 05 Apr 2010 11:35:06 GMT</Date>
</header-lines>
<message-body>
<Html>
<Title>Testing Application for HTTP Adapter</Title>
<Head></Head>
<Title>Testing Application for HTTP Adapter</Title>
<Head></Head>
<Body>Hi, I am inside the doPost() Method of the EchoServlet, <br>
<br><br><br> <br><br>
Query String : null<br><br>Key 1 Value 1<BR>
<BR> XML Text : <Center> Copyrights ©, Developed By Test User </Center>
</Body>
</Html>
</message-body>
</httpAdapterResponse>
The following figure shows an XML sample of the HTTP adapter response that contains a JSON string in <message-body> of an HTML response before parsing.
XML sample of the HTTP adapter response with a JSON string in <message-body> before parsing
<httpAdapterResponse>
<metadata>
<status>success</status>
</metadata>
<status-line>
<code>200</code>
<reason>OK</reason>
</status-line>
<header-lines>
<Transfer-encoding>chunked</Transfer-encoding>
<Content-type>text/html</Content-type>
</header-lines>
<message-body>
<html lang="en-US">
<head>
<title>BBDA API</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
{"job-approval":{"result":"approve","detail":"dsd"}}
<h1>Accepted request</h1>
</body>
</html>
</message-body>
</httpAdapterResponse>
The following figure shows an XML sample of the HTTP adapter response that contains a JSON string in <message-body> of an HTML response after parsing.
XML sample of the HTTP adapter response with a JSON string in <message-body> after parsing
<httpAdapterResponse>
<metadata>
<status>success</status>
</metadata>
<status-line>
<code>200</code>
<reason>OK</reason>
</status-line>
<header-lines>
<Transfer-encoding>chunked</Transfer-encoding>
<Content-type>text/html</Content-type>
</header-lines>
<message-body>
<html lang="en-US">
<head>
<title>BBDA API</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<job-approval>
<detail>dsd</detail>
<result>approve</result>
</job-approval>
<h1>Accepted request</h1>
</body>
</html>
</message-body>
</httpAdapterResponse>
The following figure shows an XML sample of the HTTP adapter response when <enable-redirects> is set to true.
XML sample of the HTTP adapter response when <enable-redirects> is set to true
<httpAdapterResponse>
<metadata>
<status>success</status>
</metadata>
<status-line>
<code>200</code>
<reason>OK</reason>
</status-line>
<header-lines>
<Content-Type>text/html; charset=UTF-8</Content-Type>
<Set-Cookie>GAPS=1:q7MOXHxImy7wEWqMqPxCo43uo2u_zA:qdzE-EQA_RmHPXA-;Path=/accounts;Expires=Wed, 24-Jul-2013 11:10:48 GMT;Secure;HttpOnly</Set-Cookie>
<Set-Cookie>GALX=gqHGKTY632o;Path=/accounts;Secure</Set-Cookie>
<Cache-control>no-cache, no-store</Cache-control>
<Pragma>no-cache</Pragma>
<Expires>Mon, 01-Jan-1990 00:00:00 GMT</Expires>
<X-Frame-Options>Deny</X-Frame-Options>
<X-Auto-Login>realm=com.google&args=service%3Dmail%26continue%3Dhttp%253A%252F%252Fmail.google.com%252Fmail%252F%253Fui%253Dhtml%2526zy%253Dl</X-Auto-Login>
<Date>Mon, 25 Jul 2011 11:10:48 GMT</Date>
<X-Content-Type-Options>nosniff</X-Content-Type-Options>
<X-XSS-Protection>1; mode=block</X-XSS-Protection>
<Content-Length>18700</Content-Length>
<Server>GSE</Server>
</header-lines>
<message-body><html lang="en" dir="ltr"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta name="description" content="7+ GB of storage, less spam, and mobile access. Gmail is email that's intuitive, efficient, and useful. And maybe even fun.">
...
</html></message-body>
</httpAdapterResponse>
The following figure shows an XML sample of the HTTP adapter response when <enable-redirects> is set to false.
XML sample of the HTTP adapter response when <enable-redirects> is set to false
<httpAdapterResponse>
<metadata>
<status>success</status>
</metadata>
<status-line>
<code>302</code>
<reason>Moved Temporarily</reason>
</status-line>
<header-lines>
<Content-Type>text/html; charset=UTF-8</Content-Type>
<Cache-Control>no-cache, no-store, max-age=0, must-revalidate</Cache-Control>
<Pragma>no-cache</Pragma>
<Expires>Fri, 01 Jan 1990 00:00:00 GMT</Expires>
<Date>Mon, 25 Jul 2011 11:06:29 GMT</Date>
<Location>https://www.google.com/accounts/ServiceLogin?service=mail&passive=true&rm=false&continue=http%3A%2F%2Fmail.google.com%2Fmail%2F%3Fui%3Dhtml%26zy%3Dl&bsv=llya694le36z&scc=1<mpl=default<mplcache=2&from=login</Location>
<X-Content-Type-Options>nosniff</X-Content-Type-Options>
<X-Frame-Options>SAMEORIGIN</X-Frame-Options>
<X-XSS-Protection>1; mode=block</X-XSS-Protection>
<Server>GSE</Server>
<Content-Length>423</Content-Length>
<Connection>Keep-Alive</Connection>
</header-lines>
<message-body><HTML><HEAD><TITLE>Moved Temporarily</TITLE></HEAD><BODY BGCOLOR="#FFFFFF" TEXT="#000000"><H1>Moved Temporarily</H1>The document has moved <A HREF="https://www.google.com/accounts/ServiceLogin?service=mail&passive=true&rm=false&continue=http%3A%2F%2Fmail.google.com%2Fmail%2F%3Fui%3Dhtml%26zy%3Dl&bsv=llya694le36z&scc=1&ltmpl=default&ltmplcache=2&from=login">here</A>.</BODY></HTML></message-body>
</httpAdapterResponse>