So you want to developp for mobile, right ? IOS or Android ?
Anyway :
-the first thing you need to do is to find a simple command (using XMLRPC) from the API of Joomla or Wordpress. Read their documentation.
-then in your stack, use the XMLRPC library in order to send the query (you need IP address of the server, port number, and path)
Example of a basic query, very simple, without any parameter.
Code: Select all
put revXMLRPC_CreateRequest("36.255.255.12","8079","xmlrpc/common","http") into rpc_id -- Create the initial connection.
revXMLRPC_SetMethod rpc_id, "get_server_environment" -- Specify the method to call, from the API of Joomla or Wordpress
put revXMLRPC_Execute(rpc_id) into result_id -- Submit & get the results.
put revXMLText (result_id) into tResult
answer tResult
if revXMLRPC_Documents() is not empty then revXMLRPC_DeleteAllDocuments
Usually a XMLRPC query must be sent with parameters. For that, use revXMLRPC_AddParam
Code: Select all
put revXMLRPC_CreateRequest("36.255.255.12","8079","xmlrpc/common","http") into rpc_id -- Create the initial connection.
revXMLRPC_AddParam rpc_id, "string", "MyFirstString" --this is the parameter, a string that contains "MyFirstString
revXMLRPC_SetMethod rpc_id, "get_my_name" -- Specify the method to call, from the API
put revXMLRPC_Execute(rpc_id) into result_id -- Submit & get the results.
put revXMLText (result_id) into tResult
answer tResult
if revXMLRPC_Documents() is not empty then revXMLRPC_DeleteAllDocuments
Now... Eventhough the name is scary, a XMLRPC query is nothing else than :
-a http header
-a message in XML (with XML tags)
... a long string of text !
So, in the first query, here is the raw data that are basically sent to the server.
Code: Select all
POST http://36.255.255.12:8079/xmlrpc/common HTTP/1.1
Host: 36.255.255.12:8079
User-Agent: LiveCode/5.5.3 (Win32)
Content-Length: 104
Content-Type: text/xml
<?xml version="1.0"?>
<methodCall><methodName>get_server_environment</methodName><params/></methodCall>
It's easy to "emulate" those data, and send them to the server using special header and a POST.
Code: Select all
set the httpheaders to fld "header"
post tXML to url tServer
answer it
I remind you that the XMLRPC library is missing -currently- for IOS and Android. So, this is the only way.
A tip :
-use XMLRPC library to build your queries in Livecode Desktop
-then install fiddler (a very good trafic analyser, with a proxy)
-send your queries
-fiddler will display the "raw data" sent to the server (with header and content, and even the answer from the server, again with header and content)
-it will give you a clear view and understanding of what to do in order to create in raw text your XMLRPC queries
Watch out, this work can be tedious... especially for queries with many parameters...
Plus you'll have to work again in order... to decode/analyze the answers from the server... Because it will be XML strings. For that : XML library and arrays.
So basically, if you start from scratch... you'll need time. And some pain.
But it's working fine.