Special Command Tags
[HTTP / HTTPS] Remote Call to Apache Server
 

This interface is a +PxPlus Exclusive

Formats Call Remote Subprogram: CALL "[ HTTP:server ]subprog [;entry] " [,ERR=stmtref ][ ,arglist
   
Where:
[HTTP:server] The HTTP clause (or HTTPS) initiates the remote CALL. to the subprogram/entry point and web server specified. If HTTPS is specified, a secure connection is used.
arglist Optional comma separated list of arguments to pass to the subprogram.
server Network name or address of the server running Apache with the associate PxPlus HTTP Call extensions configured.
subprog Name of the subprogram that is to be call on the server. The true program name on the server must end with .pxc which will be automatically appended, if omitted in the CALL.
;entry Entry point label. (Optional.) If you include a label, it must start with "EP_" and be separated from the program name with a semicolon.
stmtref Program line number or statement label to which to transfer control.
   
Description When the [HTTP: ...] or [HTTPS: ...] tag is used as a prefix to a program name in a PxPlus CALL directive, the system will physically process the call on the web site specified in server.

PxPlus will internally pass the arglist and program name to the server specified using "SOAP" based XML data packets which, in turn, will load and run the program.

When the subprogram completes, the server will return any updated variables found within the arglist to the caller or, should an error occur, the error condition will be returned to the calling program.

To support this interface the server must be running an APACHE HTTP server with the PxPlus HTTP Call extensions configured. Please refer to the Apache Interface Configuration section for additional details.

Unlike the RPC interface, this capability supports multiple instances of the program on the server. Each CALL will invoke a new instance that will be terminated after the subprogram exits.



*Note* Like the ProvideX RPC interface, the HTTP/HTTPS interface requires a Professional or E-Commerce Activation on the server. As this interface is not capable of serving web pages, it does not require an E-Commerce license.


Test Site A test site for the CALL [HTTP] interface has been established at the website "call.pvxplus.com".

This site contains a dummy data file and a sample callable subprogram "getcust.pxc". The contents of this program are as follows:

0010 ! Sample HTTP call routine - getcust.pxc
0020 ENTER CUSTNO$,RECORD$
0030 OPEN (1)"arcust"
0040 READ RECORD (1,KEY=CUSTNO$)RECORD$
0050 CLOSE (1)
0060 END
0070 !
0080 ! Get range of records
0090 !
0100 EP_RANGE:
0110 ENTER FIRST$,LAST$,RECORDS$
0120 LET RECORDS$=""
0130 SELECT RECORD R$ FROM "arcust" BEGIN FIRST$ END LAST$
0140 LET RECORDS$+=R$+$00$
0150 NEXT RECORD
0160 END
0170 !
0180 ! Get the IOLIST for the file
0190 !
0200 EP_IOLIST:
0210 ENTER IOLIST$
0220 OPEN (1,IOL=*)"arcust"
0230 LET IOLIST$=IOL(1)
0240 CLOSE (1)
0250 END

This program can be called remotely by issuing the following on a Professional, Demo, or Ecommerce version of PxPlus:

->K$ = "000555" ! or "000385", "000461" and others
->CALL
"[HTTP:call.pvxplus.com]getcust", K$, R$
->PRINT R$
000555
Mike was here
8450 Buga-Buga Drive
Unionville
WL
11.43

This will read the record whose key is "000555" and return its contents in R$ -- effectively running the above program starting at line 10. Note that the system will append the .pxc suffix to the file name automatically.

There is also an EP_RANGE entry point that will return a range of records with $00$ as a record separator. You can use this entry point to get a list of all the records in the file.

->CALL "[HTTP:call.pvxplus.com]getcust;EP_Range", "","999999",Recs$

To retrieve the internal IOLIST for the data file call the entry point EP_IOLIST as in:

->CALL "[HTTP:call.pvxplus.com]getcust;EP_Iolist", Io_list$
->PRINT LST(Io_list$)
IOLIST CUST_NO$,NAME$,ADDR1$,CITY$,SALESPERSON$,AMT_OWING

   
Test Configration The APACHE HTTP server configuration file used for this web site is as follows:

cat /etc/httpd/conf.dcall.conf
#
# PxPlus HTTP interface CGI definition
#
AddHandler pxplus-call .pxc
Action pxplus-call /cgi-bin/pxcall.cgi

<VirtualHost 208.68.90.163:80>
ServerName call.pvxplus.com
DocumentRoot "/var/www/pvxplus/httpcall"
</VirtualHost>



*Note* Our web site uses an Apache Virtual Host for this connection as the IP address is shared many of our host services.