How to: |
A process flow contains all the business logic and performs the required processing. It parses the received event document to retrieve the parameter for the requested file name. It validates that the requested file exists. If the file exists, the process flow retrieves the content of the file. If the file is not available, the process flow returns a default error message.
To configure a process flow:
The service is based on the Class Name XDSREGAgent, which allows for the setting of special registers.
The IFL statement for the value will perform an XPATH into the event document which is received from the nHTTP listener. It will extract the parameter value from the document which holds the URL part provided by the user. Then it will parse it and get the file title value after the '=' sign. Below is a sample of the event signal document returned by nHTTP with a marked "action" parameter. So in this example, the file SREG will be set to myfile.txt.
Sample URL provided by user:
http://localhost:2222/file=myfile.txt
Sample Event document from nHTTP:
<http user="unknown" type="GET">
<parms>
<parm name="ibse-port">9000</parm>
<parm name="Host">localhost:2222</parm>
<parm name="Connection">keep-alive</parm>
<parm name="pdm">0</parm>
<parm name="version">1.1</parm>
<parm name="Accept-Language">en-us,en;q=0.5</parm><parm name="action">file=myfile.txt</parm><parm name="Keep-Alive">300</parm>
<parm name="Accept"> text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
</parm>
<parm name="User-Agent">
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.8.1.20) Gecko/20081217 Firefox/2.0.0.20 (.NET CLR
3.5.30729)
</parm>
<parm name="url">/file=myfile.txt</parm>
<parm name="ip">127.0.0.1</parm>
<parm name="source">hostname unknown</parm>
<parm name="Accept-Charset">ISO-8859-1,utf-8;q=0.7,*;q=0.7</parm>
<parm name="Accept-Encoding">gzip,deflate</parm>
<parm name="reqType">GET</parm>
</parms>
<body/>
<url secure="false">
<host>localhost</host>
<port>2222</port>
<path>/file=myfile.txt</path>
<query/>
</url>
<version>1.1</version>
</http>
iWay Software |