Getting information from remote server with XML-RPC

I want to connect to an xml-rpc service and then parse and display the information. I found the following lua module:

https://github.com/timn/lua-xmlrpc

Can this be made to work with Corona? It makes use of the Expat C library.

And if so, is it just a matter of including it in the app directory?

Thanks! [import]uid: 41116 topic_id: 7662 reply_id: 307662[/import]

@bainem have you had any luck with this?

I’ve tried copying that library into a “xmlrpc” directory in my project, but when I try to use it with either of the following…
[lua]local xmlrpc = require(“xmlrpc”)
– or
require “xmlrpc”[/lua]
…I get a notification saying that “A runtime error occurred. Please check console output for details.”. The console shows this:
[text]
Copyright © 2009-2010 A n s c a , I n c .
Version: 2.0.0
Build: 2011.484
The file sandbox for this project is located at the following folder:
(/Users/XXXXXXX/Library/Application Support/Corona Simulator/HelloWorld-AEDF5EFDA992C00282C76B97CEC84EBD)
Runtime error
/Users/XXXXXXX/dev/android/corona/HelloWorld/main.lua:10: module ‘xmlrpc’ not found:resource (xmlrpc.lu) does not exist in archive
no field package.preload[‘xmlrpc’]
no file ‘/Users/XXXXXXX/dev/android/corona/HelloWorld/xmlrpc.lua’
no file ‘/Applications/CoronaSDK/Corona Simulator.app/Contents/Resources/xmlrpc.lua’
no file ‘/Applications/CoronaSDK/Corona Simulator.app/Contents/Resources/xmlrpc.blu’
stack traceback:
[C]: ?
[C]: in function ‘require’
/Users/XXXXXXX/dev/android/corona/HelloWorld/main.lua:10: in main chunk
Runtime error: /Users/XXXXXXX/dev/android/corona/HelloWorld/main.lua:10: module ‘xmlrpc’ not found:resource (xmlrpc.lu) does not exist in archive
no field package.preload[‘xmlrpc’]
no file ‘/Users/XXXXXXX/dev/android/corona/HelloWorld/xmlrpc.lua’
no file ‘/Applications/CoronaSDK/Corona Simulator.app/Contents/Resources/xmlrpc.lua’
no file ‘/Applications/CoronaSDK/Corona Simulator.app/Contents/Resources/xmlrpc.blu’
stack traceback:
[C]: ?
[C]: in function ‘require’
/Users/XXXXXXX/dev/android/corona/HelloWorld/main.lua:10: in main chunk
[/text]

I get the same result if I move the “xmlrpc” directory to “/Applications/CoronaSDK/Corona Simulator.app/Contents/Resources/”

I’m certain that this initial problem is related to how I’m installing the library, or how I’m calling it, and that once I sort that out I can at least move on to the next error.

I’m just getting started with Lua and Corona, and I’m just not sure how to proceed.

Does anybody have an example of how to use Lua XML-RPC with Corona? Or even a general example of how to use a third-party library with Corona?


Update:

OK, I got a bit further by putting "server.lua", "http.lua", and "init.lua" from the XML-RPC library directly into my project directory, and then called it with this:
[lua]local xmlrpc = require "init"[/lua]
That seemed to load the library, but then failed when it tried to load the "lxp" library:
[text]
Runtime error
/Users/XXXXXX/dev/android/corona/HelloWorld/init.lua:6: module 'lxp' not found:resource (lxp.lu) does not exist in archive
no field package.preload['lxp']
no file '/Users/XXXXXX/dev/android/corona/HelloWorld/lxp.lua'
no file '/Applications/CoronaSDK/Corona Simulator.app/Contents/Resources/lxp.lua'
no file '/Applications/CoronaSDK/Corona Simulator.app/Contents/Resources/lxp.blu'
stack traceback:
[C]: ?
[C]: in function 'require'
/Users/XXXXXX/dev/android/corona/HelloWorld/init.lua:6: in main chunk
[C]: in function 'require'
/Users/XXXXXX/dev/android/corona/HelloWorld/main.lua:10: in main chunk
[/text]
So, I think the solution here is going to be some general guidance for including and using third-party libraries in a Corona project. Anybody?
[import]uid: 61179 topic_id: 7662 reply_id: 37480[/import]

Help getting XMLRPC working!

I am also struggling to get this working.
I would like to be using xmlrpc with my Drupal services, but am unable to understand how to get the lua side installed/working.

I am new to lua (coming from AS3) and am also new to the Mac (OSX) and feel their needs to be some basic step by step on installing and using these 3rd party libraries.

This is the library: https://github.com/timn/lua-xmlrpc
and this a required library to use it: http://matthewwild.co.uk/projects/luaexpat/manual.html#introduction (The installation notes make no sense to me and I’ve tried all sorts of things).

I know Newbie questions can seem to dumb to answer if you’re experienced, but there are lots of new comers that are experts in other fields and we would really appreciate your help.

Thanks
h [import]uid: 58388 topic_id: 7662 reply_id: 40618[/import]

Any success with this? [import]uid: 15797 topic_id: 7662 reply_id: 53832[/import]

Any luck interfacing Corona SDK with Drupal through Services? I’m keen to help get this working if you need assistance? [import]uid: 21125 topic_id: 7662 reply_id: 78320[/import]

I think there’s no need for external XML-RPC lib. Use http://developer.anscamobile.com/reference/index/networkrequest to send request to a your Drupal service.

On your Drupal site build a custom service that would hook to incoming request. Should be easy. I’ve done something like that with AMF to a Drupal service. Shouldn’t be much different from JSON to Drupal. [import]uid: 78942 topic_id: 7662 reply_id: 83759[/import]