Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

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

-script

File containing the options that define the service request to be executed.

-script_type

Type of script specified by -script, which is a service request in this example.

-host

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.

-userid

Valid user name on the host specified by the -host option.

-pwd

Valid password for the user name specified by the -userid option.

Components

Universal Command

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.


Each of the Universal Command Agent for SOA options are described below.

Option

Description

-protocol

Protocol used for the service request.

-httpmethod

HTTP method, such as GET or POST.

-httpformdata

Specification for whether or not form data is included in the service request.

-mep

Message exchange pattern. HTTP POST always use a Request pattern.

-serviceurl

URL identifying the location of the HTTP request.

-timeoutsec

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.

  • No labels