[Gambas-user] XmlRpc
Jesus Guardon
jguardon at ...2035...
Tue May 19 22:08:15 CEST 2009
Hi Ron and all
Many thanks for your example, I will try to understand and adapt it to
my needs. Until then, I'll let you know if it works.
Kind regards
Jesus
Ron escribió:
> Jesus Guardon schreef:
>> Hi all
>>
>> Anyone has been using XmlRpc component of Gambas?
>> No documentation already done for it, and I need to communicate with
>> another app via this protocol.
>> At a first glance, I'm unable to understand how to use, any help please?
>>
>> Using Gambas2 - 2.12.0 on Ubuntu 8.10
>>
>> Regards
>>
>> Jesus
>>
>>
> Hi,
>
> Yes I'm using the server part, I talk to it with PHP 5 xmlrpc.
>
> Look here for the server part:
> http://www.domotiga.nl/projects/domotiga/browser/trunk/DomotiGa/CXMLRPC.class
>
> This is a _very raw_ client example:
>
> ---
> ' Gambas module file
> PUBLIC SUB Main()
>
> DIM RpcF AS RpcFunction
> DIM myStruc AS RpcStruct
> DIM client AS RpcClient
> DIM hVar AS NEW Variant[]
> DIM ret AS Variant
> DIM a AS Integer
> DIM name AS String
> DIM dType AS Integer
>
> a = 0
>
> RpcF = NEW RpcFunction("sample.sumAndDifference", [XmlRpc.xInteger,
> XmlRpc.xInteger], XmlRpc.xStruct)
> client = NEW RpcClient(RpcF)
> client.URL = "http://xmlrpc-c.sourceforge.net/api/sample.php"
> hVar.Add(5)
> hVar.Add(3)
>
> myStruc = client.Call(hVar)
> DO WHILE a < myStruc.Count
> name = myStruc.Key(a)
> dType = myStruc.dataType(a)
> ret = myStruc.Value(a)
>
> DEBUG "Name = " & name
> DEBUG "Type = " & dType
> DEBUG "Value = " & ret
>
> INC a
> LOOP
>
> END
>
> It returns:
>
> MMain.Main.28: Name = sum
> MMain.Main.29: Type = 0
> MMain.Main.30: Value = 8
> MMain.Main.28: Name = difference
> MMain.Main.29: Type = 0
> MMain.Main.30: Value = 2
>
>
> Regards,
> Ron_2nd.
>
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables
> unlimited royalty-free distribution of the report engine
> for externally facing server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
More information about the User
mailing list