Hello,I'm currently experimenting with the gb.xml.rpc component. An XMLRPC client works well (see archive attached). Now I would like to offer on the installed Web server Lighttpd (under Mint 17.1) a webservice (XMLRPC server) and via the XMLRPC client call. The following source code for the XMLRPC server provides an error in line ***. Can someone help me?
Hans ' Gambas module file Public hXMLRPC As RpcServer Public Sub Main() Dim hXMLRPCFunction As RpcFunction Dim iXMLRPCPort, iXMLRPCServerMaxConnections As Integer hXMLRPC = New RpcServer As "hXMLRPC" iXMLRPCPort = 9009 iXMLRPCServerMaxConnections = 1hXMLRPCFunction = New RpcFunction("add2integer", [XmlRpc.xInteger, XmlRpc.xInteger], XmlRpc.xInteger)
' hXMLRPCFunction.Help = ("Addition of 2 integers") hXMLRPC.Register(hXMLRPCFunction) Try hXMLRPC.Listen(iXMLRPCPort, iXMLRPCServerMaxConnections) ' *** If Error ThenPrint "Error-Text: " & Error.Text & gb.NewLine & "Error-Location: " & Error.Where
hXMLRPC.Stop() Endif If hXMLRPC.Listening Then Print "The XMLRPC server listens for port " & Str(iXMLRPCPort) Endif End Public Sub hXMLRPC_RemoteCall(sMethod As String, aParameters As Variant[]) Select Case sMethod Case "add2integer" Sum(aParameters) End Select End Public Sub Sum(aParameters As Variant[]) hXMLRPC.SetReply(aParameters[0] + aParameters[1]) hXMLRPC.Stop() End
XMLRPCC-0.0.9.tar.gz
Description: application/gzip
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user