[Gambas-user] Gambas XMLRPC Server and method with more than 1 parameter

Ron ron at ...1740...
Wed Nov 18 20:38:49 CET 2009


Hi,

anyone has the above working by any chance?

It works with parameter (NULL) and 1 parameter but not with more than 1.

The XMLRPC Client is ok, I have tested it against a non Gambas XMLRPC 
server.
But if you post more than one parameter to the Gambas XMLRPC server, it 
doesn't check the correct amount, and it only passes the first one to 
the Callback routine.

I need it for my project,  but I'm afraid I have to dive into the 
Component again. ;-(

The code I made:
---
PUBLIC FUNCTION Connect() AS Boolean

  DIM hRpcFunc AS RpcFunction

  hXMLRPC = NEW RpcServer AS "hXMLRPC"

  hRpcFunc = NEW RpcFunction("send.email", [XmlRpc.xString, 
XmlRpc.xString, XmlRpc.xString], XmlRpc.xBoolean)
  hRpcFunc.Help = ("send email to param1, with subject param2 and body 
param3")
  hXMLRPC.Register(hRpcFunc)

  TRY hXMLRPC.Listen(iHTTPPort, iMaxConn)
  IF NOT hXMLRPC.Listening THEN
    RETURN FALSE
  END IF
  RETURN TRUE

END
---

---
PUBLIC SUB hXMLRPC_RemoteCall(sName AS String, sData AS Variant[])

  SELECT CASE sName
    CASE "send.email"
      SendEmail(sData)
    ...
 END SELECT

END
---
PRIVATE SUB SendEmail(sParams AS Variant[])

  DIM sParam AS String

   ' it only contains the first parameter param1
  FOR EACH sParam IN sParams
     PRINT sParam
  NEXT

END

Kind Regards,
Ron_2nd.




More information about the User mailing list