UAC HTTP Form - Windows and UNIX
Example of Universal Command HTTP POST with Form Data
The following is an example of Universal Command Manager executing a Universal Command Agent for SOA HTTP POST request with form data. The service request is specified in the script file, options.txt
, and the HTTP form data is provided as standard input file form-data.xml
.
ucmd -script options.txt -script_type service -host dallas -userid username -pwd password < form-data.xml
Universal Command Options
The Universal Command Manager command line options used in this example are:
Option | Description |
---|---|
File containing the options that define the service request to be executed. | |
Type of script specified by -script, which is a service request in this example. | |
Host name or IP Address of the Universal Broker where a Universal Application Container (UAC) is executing. The service request is ultimately executed by the UAC component on behalf of the Universal Command Manager. | |
Valid user name on the host specified by the -host option. | |
Valid password for the user name specified by the -userid option. |
Components
Universal Command Agent for SOA
Service Options
The service request is specified with Universal Command Agent for SOA options in the Universal Command script file referred to by the -script option. The example above specifies script file options.txt
on the -script option. The contents of options.txt
specifies the following HTTP POST request to be executed.
-protocol http -httpmethod post -httpformdata true -mep request -serviceurl http://www.acme.com/cgi-bin/comment-form.cgi -timeoutsec 60
Each of the Universal Command Agent for SOA options are described below.
Option | Description |
---|---|
Protocol used for the service request. | |
HTTP method, such as GET or POST. | |
Specification for whether or not form data is included in the service request. | |
Message exchange pattern. HTTP POST always use a Request pattern. | |
URL identifying the location of the HTTP request. | |
Number of seconds to wait for a response from the HTTP server. |
Form Data
The example HTTP POST request provides the form data as standard input file form-data.xml
. The form data is formatted as an XML document. The following form-data.xml
file is an example that provides two name-value pairs that will be part of the HTTP POST request:
<?xml version="1.0" encoding="UTF-8"?> <p:HTTPFormData xmlns:p="http://com.stonebranch/UAI/HTTPFormData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://com.stonebranch/UAI/HTTPFormData HTTPFormData.xsd "> <p:Property> <p:Name>Comments</p:Name> <p:Value>You only live once, but if you work it right, once is enough.</p:Value> </p:Property> <p:Property> <p:Name>box</p:Name> <p:Value>yes</p:Value> </p:Property> </p:HTTPFormData>
See the HTTP_FORM_DATA option for a description of the XML Schema Definition (XSD) for providing form data key-value pairs.