Hi,
I'm not into games ( yet ).
I would like to learn how to use Lua to setup a form
to query for some information on a website.
Preferrably the website would be running .Net with Sql Server
( use of a Web Service which returns XML )
Is this going to use the Sockets thingy ? If so any examples ?
Thanks, LA Guy
@pceinc88,
you do not require *socket thingy* using the GET, POST and PUT, you can get/set data with website using the normal HTTP or REST protocols. Look up what you are wanting but for Lua than CoronaSDK, you will find plenty of examples.
cheers,
?:)
You can create a .net code to return an xml file
the output can be somethign like this
http://technowand.com/xml/clients.xml
now you can parse this XML file to get the data
I used something like this
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
| function main()
-- XMLParser.lua file should be in the folder
local parser = require( "XMLParser" )
-- calling function to parse XML file
-- returns a lua table
--from a local xml file
--local tab1 = parser.ParseXmlFile("result.xml")
-- calling function to parse XML from website
local tab1 = parser.getXMLData("http://technowand.com/xml/clients.xml")
for i=1,3,1 do
for j=1,5,1 do
print(tab1[i][j])
end
end
end
main() |
Ok, thanks I will try and search: LUA Http or Rest to find examples later.
Cheers, LA Guy
@technowadd
Wow, thank you very much for this example.
I will study this and try to create my own working example.
( in a day or two ).
Appreciate your getting me kick started with this stuff !
happy day to all, LA Guy