Main Board > Web Services

Web request returns the program


Hello.  I am trying to implement an API that accepts a part number and verifies that it is on file.  The attached .pxp program is what the API executes.

I am testing the API by executing the following code:
2610 LET URL$=""
2620 LET URL$=SUB(URL$," ","%20")
2630 LET URL$=SUB(URL$,"|","%7C")
2640 LET URL$=SUB(URL$,"^","%5E")
2650 !
2660 SETERR 2690
2670 CALL "*PLUS/WEB/REQUEST",URL$,X$,Y$,Z$; REM "x$ is data, y$ is response, z$=response header

After 2670 executes X$ is nothing, and Y$ is a listing of my API program.  I don't understand why I am getting a program listing instead of my XML result.  What am I doing wrong?

Version 14.1, RedHat Linux, using the PxPlus web server.

Mike King:
If you are getting a listing of your program then the .pxp file on the server is likely not a program file but rather a text file containing the source of the program.

Unlike native PxPlus which will automatically compile a text file to program format in memory, the web server requires that the .pxp files be true compiled program files.

Thanks Mike, for some reason I thought it needed to be a text file.

I have saved it as a regular program, and now I am getting an error 121 "invalid program format" on line 1000 where it is just opening a keyed file.


Since the file has an embedded IO program associated with it, I figured the error might be caused by it being unable to locate the IO program.  So I added the path to it to the prefix.  That fixed the error 121, but now I am getting an error 12 on line 1000.  I will keep trying.

It's working now.  I needed to add our standard prefixes at the top of the program.

Thanks for your help - much appreciated!


[0] Message Index

Go to full version