You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@ws.apache.org by cyrille <cy...@kbuilder.net> on 2002/09/11 00:30:30 UTC
about example
hello,
I just try to run examples, after reading doc.
It's seems to running fine, but not at all ...
It seems to always use the default Handler : Echo()
1 / I lauch a server :
$ java org.apache.xmlrpc.WebServer
Usage: java org.apache.xmlrpc.WebServer <port>
started web server on port 8080
2 / then a client :
$ java org.apache.xmlrpc.XmlRpcClient http://localhost:8080 echo toto
[toto]
so that's working.
but if I try other method I've found in source like "string" or "math"
e.g. : in class org.apache.xmlrpc.WebServer :
...
webserver.addHandler("string", "Welcome to XML-RPC!");
webserver.addHandler("math", Math.class);
...
It is always do like if calling the default Hnadler : method "echo" :
$ java org.apache.xmlrpc.XmlRpcClient http://localhost:8080 string abc
[abc]
$ java org.apache.xmlrpc.XmlRpcClient http://localhost:8080 math abc
[abc]
Is some one get a idea ???
Cyrille
Re: about example
Posted by cyrille <cy...@kbuilder.net>.
Thanks Daniel for your answer.
But really, I shurely miss somthing !please, help me running simple
stuff ;o)
I'd donwloaded xmlrpc1.1 to maje my test.
In Webserver.Main there are some Handler added :
WebServer webserver = new WebServer(i);
webserver.addHandler("string", "Welcome to XML-RPC!");
webserver.addHandler("math", java.lang.Math.class);
webserver.addHandler("auth", new AuthDemo());
webserver.addHandler("$default", new Echo());
webserver.addHandler("mttf", new
XmlRpcClient("http://www.mailtothefuture.com:80/RPC2"));
if I start the server :
> java org.apache.xmlrpc.WebServer
Usage: java org.apache.xmlrpc.WebServer <port>
started web server on port 8080
then the client :
> java org.apache.xmlrpc.XmlRpcClient http://localhost:8080 echo abcd
[abcd]
we can see that class Echo is used.
But if I try to call other handler, I get exactly the same behavior :
> java org.apache.xmlrpc.XmlRpcClient http://localhost:8080 string abcd
[abcd]
> java org.apache.xmlrpc.XmlRpcClient http://localhost:8080 math abcd
[abcd]
> java org.apache.xmlrpc.XmlRpcClient http://localhost:8080 auth abcd
[abcd]
Shure I miss something.
Please, can you tell me what is wrong in that example call ?
Cyrille
Daniel L. Rall wrote:
>On Wed, 11 Sep 2002, cyrille wrote:
>
>
>
>>hello,
>>
>>I just try to run examples, after reading doc.
>>It's seems to running fine, but not at all ...
>>
>>It seems to always use the default Handler : Echo()
>>
>>1 / I lauch a server :
>> $ java org.apache.xmlrpc.WebServer
>> Usage: java org.apache.xmlrpc.WebServer <port>
>> started web server on port 8080
>>2 / then a client :
>> $ java org.apache.xmlrpc.XmlRpcClient http://localhost:8080 echo toto
>>[toto]
>>
>>so that's working.
>>but if I try other method I've found in source like "string" or "math"
>>e.g. : in class org.apache.xmlrpc.WebServer :
>> ...
>> webserver.addHandler("string", "Welcome to XML-RPC!");
>> webserver.addHandler("math", Math.class);
>> ...
>>
>>It is always do like if calling the default Hnadler : method "echo" :
>>
>> $ java org.apache.xmlrpc.XmlRpcClient http://localhost:8080 string abc
>> [abc]
>> $ java org.apache.xmlrpc.XmlRpcClient http://localhost:8080 math abc
>> [abc]
>>
>>Is some one get a idea ???
>>
>>
>
>It looks like the string and math handler are mapped to the echo handler, as
>you guess. Check the source code for your version to see for sure, or try the
>latest from CVS to see if it still does the same thing.
>
> --
>
>Daniel Rall <dl...@finemaltcoding.com>
>
>
>
>
>
Re: about example
Posted by cyrille <cy...@kbuilder.net>.
Thanks Daniel for your answer.
But really, I shurely miss somthing !please, help me running simple
stuff ;o)
I'd donwloaded xmlrpc1.1 to maje my test.
In Webserver.Main there are some Handler added :
WebServer webserver = new WebServer(i);
webserver.addHandler("string", "Welcome to XML-RPC!");
webserver.addHandler("math", java.lang.Math.class);
webserver.addHandler("auth", new AuthDemo());
webserver.addHandler("$default", new Echo());
webserver.addHandler("mttf", new
XmlRpcClient("http://www.mailtothefuture.com:80/RPC2"));
if I start the server :
> java org.apache.xmlrpc.WebServer
Usage: java org.apache.xmlrpc.WebServer <port>
started web server on port 8080
then the client :
> java org.apache.xmlrpc.XmlRpcClient http://localhost:8080 echo abcd
[abcd]
we can see that class Echo is used.
But if I try to call other handler, I get exactly the same behavior :
> java org.apache.xmlrpc.XmlRpcClient http://localhost:8080 string abcd
[abcd]
> java org.apache.xmlrpc.XmlRpcClient http://localhost:8080 math abcd
[abcd]
> java org.apache.xmlrpc.XmlRpcClient http://localhost:8080 auth abcd
[abcd]
Shure I miss something.
Please, can you tell me what is wrong in that example call ?
Cyrille
Daniel L. Rall wrote:
>On Wed, 11 Sep 2002, cyrille wrote:
>
>
>
>>hello,
>>
>>I just try to run examples, after reading doc.
>>It's seems to running fine, but not at all ...
>>
>>It seems to always use the default Handler : Echo()
>>
>>1 / I lauch a server :
>> $ java org.apache.xmlrpc.WebServer
>> Usage: java org.apache.xmlrpc.WebServer <port>
>> started web server on port 8080
>>2 / then a client :
>> $ java org.apache.xmlrpc.XmlRpcClient http://localhost:8080 echo toto
>>[toto]
>>
>>so that's working.
>>but if I try other method I've found in source like "string" or "math"
>>e.g. : in class org.apache.xmlrpc.WebServer :
>> ...
>> webserver.addHandler("string", "Welcome to XML-RPC!");
>> webserver.addHandler("math", Math.class);
>> ...
>>
>>It is always do like if calling the default Hnadler : method "echo" :
>>
>> $ java org.apache.xmlrpc.XmlRpcClient http://localhost:8080 string abc
>> [abc]
>> $ java org.apache.xmlrpc.XmlRpcClient http://localhost:8080 math abc
>> [abc]
>>
>>Is some one get a idea ???
>>
>>
>
>It looks like the string and math handler are mapped to the echo handler, as
>you guess. Check the source code for your version to see for sure, or try the
>latest from CVS to see if it still does the same thing.
>
> --
>
>Daniel Rall <dl...@finemaltcoding.com>
>
>
>
>
>
Re: about example
Posted by "Daniel L. Rall" <dl...@finemaltcoding.com>.
On Wed, 11 Sep 2002, cyrille wrote:
> hello,
>
> I just try to run examples, after reading doc.
> It's seems to running fine, but not at all ...
>
> It seems to always use the default Handler : Echo()
>
> 1 / I lauch a server :
> $ java org.apache.xmlrpc.WebServer
> Usage: java org.apache.xmlrpc.WebServer <port>
> started web server on port 8080
> 2 / then a client :
> $ java org.apache.xmlrpc.XmlRpcClient http://localhost:8080 echo toto
> [toto]
>
> so that's working.
> but if I try other method I've found in source like "string" or "math"
> e.g. : in class org.apache.xmlrpc.WebServer :
> ...
> webserver.addHandler("string", "Welcome to XML-RPC!");
> webserver.addHandler("math", Math.class);
> ...
>
> It is always do like if calling the default Hnadler : method "echo" :
>
> $ java org.apache.xmlrpc.XmlRpcClient http://localhost:8080 string abc
> [abc]
> $ java org.apache.xmlrpc.XmlRpcClient http://localhost:8080 math abc
> [abc]
>
> Is some one get a idea ???
It looks like the string and math handler are mapped to the echo handler, as
you guess. Check the source code for your version to see for sure, or try the
latest from CVS to see if it still does the same thing.
--
Daniel Rall <dl...@finemaltcoding.com>
Re: about example
Posted by "Daniel L. Rall" <dl...@finemaltcoding.com>.
On Wed, 11 Sep 2002, cyrille wrote:
> hello,
>
> I just try to run examples, after reading doc.
> It's seems to running fine, but not at all ...
>
> It seems to always use the default Handler : Echo()
>
> 1 / I lauch a server :
> $ java org.apache.xmlrpc.WebServer
> Usage: java org.apache.xmlrpc.WebServer <port>
> started web server on port 8080
> 2 / then a client :
> $ java org.apache.xmlrpc.XmlRpcClient http://localhost:8080 echo toto
> [toto]
>
> so that's working.
> but if I try other method I've found in source like "string" or "math"
> e.g. : in class org.apache.xmlrpc.WebServer :
> ...
> webserver.addHandler("string", "Welcome to XML-RPC!");
> webserver.addHandler("math", Math.class);
> ...
>
> It is always do like if calling the default Hnadler : method "echo" :
>
> $ java org.apache.xmlrpc.XmlRpcClient http://localhost:8080 string abc
> [abc]
> $ java org.apache.xmlrpc.XmlRpcClient http://localhost:8080 math abc
> [abc]
>
> Is some one get a idea ???
It looks like the string and math handler are mapped to the echo handler, as
you guess. Check the source code for your version to see for sure, or try the
latest from CVS to see if it still does the same thing.
--
Daniel Rall <dl...@finemaltcoding.com>