HTTP Preparser (com.ibi.preparsers.XDHTTPpreParser)

Syntax:

com.ibi.preparsers.XDHTTPpreParser

Description:

The HTTP preparser transforms a key=value query string into an XML string with the GET action as the root. This preparser can be used to construct an XML document with the HTTP parameters that are being passed as a query string. The HTTP preparser can only be used with an HTTP listener.

For example, if you need to generate an XML document with the HTTP request parameters, the HTTP preparser can be used to transform the HTTP GET request for a web application.

Example:

  1. Select the HTTP (com.ibi.preparsers.XDHTTPpreParser) preparser from the Type drop-down list and click Next.

    The configuration parameters pane opens.

  2. Enter a name (for example, HttpPreparser) and an optional description.
  3. Click Finish.
  4. Configure an HTTP listener (for example, http) that is listening on port 9984.
  5. Construct a simple index.html page. For example:
    <html xmlns="urn:schemas-microsoft-com:xslt">
    <head>
    <title>Posting a File</title>
    </head>
    <body>
    <form id ="f" action="http://TestMachine:8080/newproject/postfile60.html" enctype="multipart/form-data">
    <input type="file" name="fdata"/>
    </form>
    </body>
    </html>
  6. In the Document Root field for the HTTP listener, specify the base directory from which the sample index.html page is served.
  7. Construct an inlet, for example, HttpPreparseInlet, which is associated with the HTTP listener (for example, http) and the new preparser (HttpPreparser).
  8. Define a simple move route and a default outlet for the channel.
  9. Build, deploy, and start the channel.
  10. Invoke the following URL from a web browser:
    http://informat-2a8d8e:9984/index.html?value1=4&value2=two

    The following output is obtained:

    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <post>
    <value1>2</value1>
    <value2>two</value2>
    </post>

iWay Software