pxd119 / as3-rpclib

Automatically exported from code.google.com/p/as3-rpclib
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Hidden "null" parameter of function call on CherryPy XML RPC Server #15

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi I'm using a CherryPy XML RPC Server.
Witch has a function witch adds 2 Strings together like this:
     def add(self, a, b):
         return a + b

-when I'm calling it like this:
    var http:HTTPService = new HTTPService();
    http.addEventListener(ResultEvent.RESULT,testVersion);
    http.addEventListener(FaultEvent.FAULT, faultHandler);
    http.url = "http://127.0.0.1:8080/xmlrpc/add/str/ing"
    http.useProxy=false;
    http.method = "GET";
    http.resultFormat="xml";
    http.send();
there is no problem and the result is "string" 

-but using as3-rpclib like this:
     rpc.add('str','ing').addResponder(new
ItemResponder(reverseResult,onFault))
     private function onFault (event : FaultEvent, token : AsyncToken =
null) : void {
           Alert.show(event.fault.faultString, event.fault.faultCode);
     } 
     private function reverseResult(event : ResultEvent, token : AsyncToken
= null) : void {
           trace(event.result.toString());
     } 
<ak33m:XMLRPCObject id="rpc" endpoint="http://127.0.0.1:8080/xmlrpc/"
></ak33m:XMLRPCObject>

There will be one parameter to much. 
-If I just call it with:
    rpc.add('str').addResponder(new ItemResponder(reverseResult,onFault))
the result is "nullstr".

Thanks

Original issue reported on code.google.com by mrwellm...@gmail.com on 30 Oct 2008 at 3:13

GoogleCodeExporter commented 8 years ago
Not sure what version of the library you are using but try setting the 
destination
and endpoint parameters on the XMLRPCObject. so destination ="/xmlrpc"
endpoint="http://127.0.0.1:8080" because on the lib it combines the two (So 
what is
happening with your call and you might be  able to see this through a http 
proxy is
the resquest is probably going through 
http://127.0.0.1:8080/xmlrpc/null/add/str/ing
or something). I believe that was fixed in the latest version of the library. 
You can
also try having endpoint="http://127.0.0.1:8080/xmlrpc" destination="". Hope 
this helps

Original comment by akeemphi...@gmail.com on 30 Oct 2008 at 7:29

GoogleCodeExporter commented 8 years ago
Thaks!

destination ="/xmlrpc"
endpoint="http://127.0.0.1:8080"
Solved the Problem :-)

Original comment by mrwellm...@gmail.com on 31 Oct 2008 at 9:03