I've set up LiveCode 5.3 server on a WAMP environment and have verified that is able to receive and send XML messages with a POST command. I'm now trying to get basic XML processing working and want to inlcude a library of XML functions that I've used and verified in a stand alone application. Here is my very basic code.
Code: Select all
<?lc set the errorMode to "inline" ?>
<?lc
local tRequestBody, theActID, tAccountArray, tempID
local tResponseMsg
require (the defaultFolder & "/" & "saverXMLControl.livecode")
-- Make sure that libraries are started
if "XMLControl" is not among the lines of the stacksInUse then
--start using stack (the defaultFolder & "/" & "saverXMLControl.livecode")
go stack "saverXMLControl.livecode"
end if
put $_POST_RAW into tRequestBody
-- Verify that data has been received
if tRequestBody is Empty then
put "ERROR: No Data Received"
exit to top
end if
-----------------------------------------------------------------------------
-- Convert the XML request to a XML Tree
-- Get the SPHR data from file and build the XML TREE
-----------------------------------------------------------------------------
put revCreateXMLTree( tRequestBody, false, true, false) into theActID
put getXMLAccount( theActID ) into tAccountArray
CheckForError tAccountArray
if the result is not Empty then
put "ERROR: Account Access "
exit to top
end if
put tAccountArray["FirstName"] && tAccountArray["LastName"]
file "C:/UniServer/www/Server/saver_newact_1_0.lc"
file "C:\UniServer\www\Server\saverXMLControl.livecode"
row 9, col 9: Chunk: can't find stack
row 9, col 1: start: can't find object
row 8, col 1: if-then: error in statement
however go stack "stack file name" does not have an error
The function getXMLAccount() is in the saverXMLControl.livecode file, but the server is not including it and give the following error response.
REVO5500<pre>
file "C:/UniServer/www/Server/saver_newact_1_0.lc"
file "C:\UniServer\www\Server\saverXMLControl.livecode"
row 25, col 6: Function: error in function handler (getXMLAccount)
row 25, col 1: put: error in expression
</pre>
When I display the stacksInUse the list is BLANK, so the stack is not being started. The Stack is not included or started.
Do I need to do something special to the saverXMLControl.livecode library to allow it to be recognized by the LiveCode server?
What is causing the "Start Using Stack" commend to fail?
What is causing LiveCode server to not including the library functions. This must be a simple setup issue.
Does anyone have a basic LiveCode server example that includes function libraries?
Thanks in advance for the help.