|
HTTP requests such as "http://localhost:9872/testpath/?filter=abc&fromdatetime=123" can be typed into the address section of your browser. You can configure Tibco BusinessWorks to receive and process such requests. By the way, note the forward slash just after the path "testpath". If you type the this trailing slash your browser will do two HTTP requests instead of one.
In order to parse a HTTP request such as "http://localhost:9872/testpath/?filter=abc&fromdatetime=123" in TibcoBusinessWorks you first create an HTTP Connection resource. In this resource which you specify the port number 9872 and the hostname of the machine you test on. First you will run your HTTP Receiver locally inside Tibco Designer so you specify "localhost" as the hostname.
Then you need to set up an process definition with an HTTP Receiver start task. You need to add two parameters to this task with the name "filter" and "fromdate". In the HTTP Receiver task you use Output Style=String and you check the box Parse Post Method Data.
Then you run the HTTP Receiver process inside Designer using the Tester. You type the HTTP request inside your browser: "http://localhost:9872/testpath/?filter=abc&fromdatetime=123" and then press Enter.
It turns out that the path in the URL is mapped to the field Command. Therefore it is usually sufficient to use the fields Method, Command and parameters for further processing of
this request.
To be more precisely you will see the following in the output of the the HTTP Receiver task in BusinessWorks:
<?xml version = "1.0" encoding = "UTF-8"?>
<ProcessStarterOutput>
<Method>GET</Method>
<RequestURI>/testpath/?filter=abc&fromdatetime=123</RequestURI>
<HTTPVersion>HTTP/1.1</HTTPVersion>
<Command>/testpath/</Command>
<QueryString>filter=abc&fromdatetime=123</QueryString>
<Header>GET /testpath/?filter=abc&fromdatetime=123 HTTP/1.1host: localhost:9872
user-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11
accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
accept-language: nl,en-us;q=0.7,en;q=0.3
accept-encoding: gzip,deflate
accept-charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
keep-alive: 300
connection: keep-alive
</Header>
<Protocol>HTTP</Protocol>
<Port>9872</Port>
<Headers>
<Accept>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</Accept>
<Accept-Charset>ISO-8859-1,utf-8;q=0.7,*;q=0.7</Accept-Charset>
<Accept-Encoding>gzip,deflate</Accept-Encoding>
<Connection>keep-alive</Connection>
</Headers>
<parameters>
<filter>abc</filter>
<fromdatetime>123</fromdatetime>
</parameters>
<ns0:Context xmlns:ns0 = "http://xmlns.tibco.com/bw/plugin-api/messages/context">
<RemoteAddress>127.0.0.1</RemoteAddress>
</ns0:Context>
</ProcessStarterOutput>
|