Package the returned result of URL as the file flow.




The function packages the returned result of URL string of HTTP service into a file flow and returns it, which can only be retrieved with segmentation forbidden.



HTTP service in the URL string format.

Parameter port is the port number configured in Http Server. The dfx path is the one relative to the main directory configured in Tool -> Options -> Environment.

Two scenarios about the syntax of writing a URL for performing an HTTP service:

I. esProc style

  Here are the syntax of writing a URL when using esProc’s HTTP service:

  http:// IP:port /dfx1.dfx()

  http:// IP:port /dfx1.dfx(arg1,arg2,...)

http://IP: port/dfx1.dfx(...)dfx2.dfx

http://[IP6]:port /dfx1.dfx()

1. There’s only one dfx file. If the dfx file has parameters, write them in order in the parentheses after the file; use comma to separate the multiple parameters. If the dfx file hasn’t parameters, the parentheses are empty; in this case the format of the file’s return value is what a user expects.

2. There are two dfx files. When the return value format a user wants is different from the format of the return value in dfx1 file, dfx2 file is used to change the format of the return value in dfx1 into a desired one. The syntax for dfx1 is the same as the that for the dfx file in the first scenario, but here the file supports only the single result set. dfx2 file is a program with only one parameter, which is the return value of dfx1 file.

  dfx2 file converts the format of the return value in dfx1 file into a desired one and return it as a result. For example, in the table sequence returned by dfx1 file, fields are by default separated by “|”; you can change dfx1’s return value in dfx2 to use the blank space as the separator.

If the second result set, which must contain strings, is returned, it is treated as the header.

3.  For IPv6, bracket the IP address with [].

II. SAP style

When the dfx file is located in a subdirectory under the main directory, you can use SAP Result type to call it.

Configure the dfx file’s path relative to the main directory in httpServer.xml’s sapPath property. The path can be of multilevel directory structure or an empty string. The latter means the file is saved directly under the main directory. If there are multiple paths in the sapPath property, separate them by comma. For example:

<?xml version="1.0" encoding="UTF-8"?>

<Server Version="1" host="" port="8503" parallelNum="10" sapPath="/sf,,/sr/pm"/>

In the above XML code, three relative paths are configured in sapPath property. They are [main directory]/sf, [main directory] and [main directory]/sr/pm.

The following shows the SAP syntax of a URL:

http://IP:port /sapPath/dfxName  For calling a dfx file without parameters

http://IP:port /sapPath/dfxName/arg1[value1]/arg2[value2],... For calling a dfx file containing parameters

sapPath is a path in httpServer.xml’s sapPath property;

dfxName is the name of dfx file, whose extension will be omitted at the call;

arg1[value1]/arg2[value2],... is the name and value of each parameter in the dfx file; parameter name must be a string of letters and parameter value is a string where the first character should be a number; the name and value will concatenate together as one string to respond to a call. Multiple parameters are separated by slash “/”.


Note:To access database data from the dfx file, configure the value of autoConnect property as true in raqsoftconfig.xml’s DB node; you can’t connect to the database if skipping this configuration.


Character set, which supports JVM's built-in character set, and which by default is the default value of virtual machine.




A parameter submitted with POST method with a syntax like p1=v1&p2=v2…. Can be omitted.

The header property can have multiple items, like headerName1:value1,headerName2:value2,... (the format is "property":"value",…); or can be omitted. The execution of .property() function over a returned file object will return the header property.

Return value:

File flow






=httpfile("http:// localhost:9090/p1.dfx()":"GBK").import@t()

Here’s the p1.dfx file:

Load p1.dfx file from the http server, with the charset as GBK



Here’s the p2.dfx file where StuId is the parameter

3 is the value of parameter in p2.dfx file



Here’s the p3.dfx file where StuId and Class are the parameters

The two parameters are separated by a comma



Here’s http2.dfx :


The returned result:




Here’s the http3.dfx

The returned result:


By default the execution of http2.dfx file returns a sequence of STATE values. To return comma-separated strings, we process the result of http2.dfx using another dfx file http3.dfx



testServlet returns a string of employee data in the JSON format





=httpfile("","{\"nodeIds\":[\"ns=102;s=AI_002_0600.PV\"], \"startTime\":\"2018/6/28 13:10:00\", \"endTime\":\"2018/6/28 13:11:0\", \"returnBounds\":\"false\", \"maxSizePerNode\":\"10\"}"; "Content-Type":"application/json")




Here’s gypb.dfx:

Set a cellset parameter:

To use the SAP Result style, first configure sapPath="/sr/pm" in httpServer.xml under [installation directory]/config/. In the URL, “/sr/pm” shows a position relative to the main directory; “gypb” points to the dfx fle gypb.dfx, and “id3/parent15” means that parameter id’s value is 3 and parameter parent’s value is 15.



There’s no need to configure sapPath if the file is under the main directory and the port number can be directly followed by /dfxName instead of the path. Here the URL means that dc.dfx is saved under the main directory and it has a parameter arg, whose value is 22.



Load emp.dfx file through http service via IPv6 connectivity using GBK charset



Upload parameters and files to an URL using the HTTP protocol.




The function uploads parameter ai and file parameter fi to an URL through HTTP protocol and returns character set cs or null or failure information when the upload fails.. Parameter ai can be absent but there must be at least one file parameter uploaded. Multiple parameters and file parameters can be uploaded as needed.



HTTP service’s URL string format


The charset of returned content, which is UTF-8 by default




Parameter values that will be parsed as a string


File parameters


The file path or BLOB

Return value:

The content of certain character set










INCLUDEPICTURE "H:\\mk:@MSITStore:D:\\0903esproc\\esProc\\documents\\zh\\函数参考.chm::\\topics\\函数参考.files\\image1224.png" \* MERGEFORMAT \d

Read the file as BLOB data



Parameters and the files have been uploaded successfully and the content of GBK charset is returned through the URL



 A file has been uploaded successfully and the content of UTF-8 charset is returned through the URL



Null is returned since the file upload fails