HTTP – Triggering Syntax (Magic xpi 4.7)
When the HTTP trigger component receives a request, it invokes its flow. The request must be written in a specific syntax. The syntax usually has two parts, static and dynamic.
Magic xpi creates a sample HTML page to facilitate the calling of a specified trigger. This HTML page is saved in the My Documents\Magic\projects\<project name>\<current project>\Service\<service name> folder.
You can click on this file to see an HTML similar to the one below. You can modify the look and feel of this HTML page.
Enter the required information in the Value column. If you have an engine running, you can then click the Call Magic xpi button. If an engine is not running, it will not work.
If you do not want to create this HTML page, you should make sure that the Generate sample HTML check box in the Service Repository's Endpoint dialog box is unchecked.
The static part is the same for all HTTP requests that are sent to trigger a flow. It is used to call the HTTP Trigger component. The dynamic part is used to pass parameters to the HTTP Trigger in Magic xpi. The amount and type of parameters that you want to pass determine how you use the dynamic part of the HTTP request.
The correct syntax is:
http://<host>/<Magic xpi>/MgWebRequester.dll?appname=IFS<projectname>&prgname=HTTP&arguments=-A<ServiceName>%23<TriggerName>&<Parameter1Name>=<Parameter1Value>
The static part of the HTTP request is written as follows:
http://<host>/<Magic xpi>/MgWebRequester.dll?appname=IFS<projectname>&prgname=HTTP
|
-
<host> should be the name of the computer where the Magic xpi server is installed. If you are using more than one Magic xpi server, the name should be for the computer with the Magic xpi server that the HTTP component is associated with.
-
<Magic xpi>: If you have more than one Magic xpi server installation on your computer, you must indicate which installation you are using for this flow. By default, Magic xpi calls each installation after the first by number, for example Magic xpi_2. Therefore, if you are using the installation called Magic xpi_2, this part of the syntax must also be called Magic xpi_2.
-
Although BLOBs are supported, you can only pass one BLOB in each parameter.
|
The dynamic part is written as follows:
&arguments=-A<ServiceName>%23<TriggerName>&<Parameter1Name>=<Parameter1Value>
|
-
&arguments=-A<ServiceName> indicates that you are going to enter the specific arguments to be called.
-
In the above syntax, %23 is required as part of the URL encoding process. %23 represents the # ASCII character.
-
<TriggerName> is the name of the trigger to be called. This is the name that you give to the HTTP Trigger in the Trigger Name field of the HTTP Trigger Configuration dialog box.
-
The second part of the dynamic section is a list of arguments where you pass parameters. These are flow, context, or global variables. You select the arguments that you want to use in the HTTP Trigger Configuration dialog box. They should be written as follows:
<Parameter1Name>=<Parameter1Value> where Parameter1Name is replaced with the name of the first parameter and Parameter1Value is replaced with the parameter's value.
Parameter1Name=Parameter1value&Parameter2Name=Parameter2value
|