RevXMLRPC-problem
Posted: Sun Nov 14, 2010 4:19 pm
Hello all,
I suppose this is a very basic question, however, I can't seem to get the XMLRPC library to work. The thing is, I want to create a connection to my server (which uses a ZEND XMLRPC-server to answer) with XMLRPC but the server doesn't recognize my parameters. A sample with a Zend XMLRPC Client, which uses as parameter "Rutger" will deliver the following answer:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse><params><param><value><string>Uw waarde: Rutger</string></value></param></params></methodResponse>
I try to get the same response from a small LiveCode-application:
on mouseUp
local host, portRPC, path, method, rpc_id
put "www.pers-e.nl" into host
put "80" into portRPC
put "nutest/xmlrpcserver.php" into path
put "echoValue" into method
put revXMLRPC_CreateRequest(host,portRPC,path,"http") into rpc_id -- Create the initial connection.
revXMLRPC_SetMethod rpc_id, method -- Specify the method to call.
revXMLRPC_AddParam rpc_id, "string", "Rutger"
put revXMLRPC_Execute(rpc_id) into result_id -- Submit & get the results.
put revXMLText (result_id) into fld "antwoord"
end mouseUp
Which gives me the following answer:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse><fault><value><struct><member><name>faultCode</name><value><int>623</int></value></member><member><name>faultString</name><value><string>Calling parameters do not match signature</string></value></member></struct></value></fault></methodResponse>
Trying to give the parameters via xml brings me just a small stap further:
on mouseUp
local host, portRPC, path, method, rpc_id
put "www.pers-e.nl" into host
put "80" into portRPC
put "nutest/xmlrpcserver.php" into path
put "echoValue" into method
put revXMLRPC_CreateRequest(host,portRPC,path,"http") into rpc_id -- Create the initial connection.
revXMLRPC_SetMethod rpc_id, method -- Specify the method to call.
put "<struct>"&\
"<params>"&\
"<param>"&\
"<value>"&\
"<string>Rutger</string>"&\
"</value>"&\
"</param>"&\
"</params>"&\
"</struct>" into theStruct
revXMLRPC_AddParam rpc_id, "xml", theStruct
put revXMLRPC_Execute(rpc_id) into result_id -- Submit & get the results.
put revXMLText (result_id) into fld "antwoord"
end mouseUp
This gives me:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse><params><param><value><string>Uw waarde: </string></value></param></params></methodResponse>
So, no mention of the input-parameter "Rutger".
What on earth am I doing wrong?
I suppose this is a very basic question, however, I can't seem to get the XMLRPC library to work. The thing is, I want to create a connection to my server (which uses a ZEND XMLRPC-server to answer) with XMLRPC but the server doesn't recognize my parameters. A sample with a Zend XMLRPC Client, which uses as parameter "Rutger" will deliver the following answer:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse><params><param><value><string>Uw waarde: Rutger</string></value></param></params></methodResponse>
I try to get the same response from a small LiveCode-application:
on mouseUp
local host, portRPC, path, method, rpc_id
put "www.pers-e.nl" into host
put "80" into portRPC
put "nutest/xmlrpcserver.php" into path
put "echoValue" into method
put revXMLRPC_CreateRequest(host,portRPC,path,"http") into rpc_id -- Create the initial connection.
revXMLRPC_SetMethod rpc_id, method -- Specify the method to call.
revXMLRPC_AddParam rpc_id, "string", "Rutger"
put revXMLRPC_Execute(rpc_id) into result_id -- Submit & get the results.
put revXMLText (result_id) into fld "antwoord"
end mouseUp
Which gives me the following answer:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse><fault><value><struct><member><name>faultCode</name><value><int>623</int></value></member><member><name>faultString</name><value><string>Calling parameters do not match signature</string></value></member></struct></value></fault></methodResponse>
Trying to give the parameters via xml brings me just a small stap further:
on mouseUp
local host, portRPC, path, method, rpc_id
put "www.pers-e.nl" into host
put "80" into portRPC
put "nutest/xmlrpcserver.php" into path
put "echoValue" into method
put revXMLRPC_CreateRequest(host,portRPC,path,"http") into rpc_id -- Create the initial connection.
revXMLRPC_SetMethod rpc_id, method -- Specify the method to call.
put "<struct>"&\
"<params>"&\
"<param>"&\
"<value>"&\
"<string>Rutger</string>"&\
"</value>"&\
"</param>"&\
"</params>"&\
"</struct>" into theStruct
revXMLRPC_AddParam rpc_id, "xml", theStruct
put revXMLRPC_Execute(rpc_id) into result_id -- Submit & get the results.
put revXMLText (result_id) into fld "antwoord"
end mouseUp
This gives me:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse><params><param><value><string>Uw waarde: </string></value></param></params></methodResponse>
So, no mention of the input-parameter "Rutger".
What on earth am I doing wrong?