RevXMLRPC-problem
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
RevXMLRPC-problem
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?
Re: RevXMLRPC-problem
Hi Rutger,
Are you Dutch? You might ask your question at http://runrev.info/rrforum/
Kind regards,
Mark
Are you Dutch? You might ask your question at http://runrev.info/rrforum/
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: RevXMLRPC-problem
Finally found the error. Not in the Rev-functions, but in the Zend-example :$
Apparently I forgot to add the param tags which tell Zend what type the values should have. The Zend-client in php worked without a problem, but both LiveCode and Flex (my second try) didn't.
Mark: Yes, I am dutch. Didn't know there are that many dutchmen using LiveCode
Apparently I forgot to add the param tags which tell Zend what type the values should have. The Zend-client in php worked without a problem, but both LiveCode and Flex (my second try) didn't.
Mark: Yes, I am dutch. Didn't know there are that many dutchmen using LiveCode

Re: RevXMLRPC-problem
Rutger-
Glad it's working now. You don't mention what platform you're working with, but for troubleshooting network stuff like this you might look at WireShark or ngrep for sniffing the network traffic, *especially* if you have a working example already.
...and I'm not sure XMLRPC counts as a "beginners" topic... <g>
Glad it's working now. You don't mention what platform you're working with, but for troubleshooting network stuff like this you might look at WireShark or ngrep for sniffing the network traffic, *especially* if you have a working example already.
...and I'm not sure XMLRPC counts as a "beginners" topic... <g>
Re: RevXMLRPC-problem
I'm working on os x and was mainly attracted to LiveCode because of the iPad output. Xmlrpc seemed like a nice topic to try for me as I am more versed in php and web apps and am planning on making apps that should sync with a server. But I am still very new to LiveCode, which uses à very diferent coding grammar, so I thought I made a stupid mistake somewhere. I have to say coding actionscript comes easier to me.
Re: RevXMLRPC-problem
<g again>
Yeah, actionscript and livecode programming are pretty different things.
But the way I debug xmlrpc stuff is the same with either: launch WireShark and log the network traffic to the server while a known good transaction is taking place, then do the same with my attempt, and note the differences. Usually there'll be something really obvious: a bad authentication header, a missed parameter, etc.
Yeah, actionscript and livecode programming are pretty different things.
But the way I debug xmlrpc stuff is the same with either: launch WireShark and log the network traffic to the server while a known good transaction is taking place, then do the same with my attempt, and note the differences. Usually there'll be something really obvious: a bad authentication header, a missed parameter, etc.