You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@ws.apache.org by Yves Gänssinger <Yv...@hiq.se> on 2013/12/12 16:25:58 UTC

DefaultHandlerMapping in XmlRpcServlet

Hello!

We need a servlet which handles XML-RPC requests from a third party. The third-party XMLRPC-API had already existed before, meaning the format of these incoming requests is fixed and we must adapt to them.

Unfortunately, these requests only contain a methodName and no handler name. Analogue to the calculator-example, the requests would only contain "add" as method name, and no "Calculator.add". To be more precise:

This is what I could handle without problems right now:
<?xml version="1.0"?><methodCall><methodName>Calculator.Add</methodName><params></params></methodCall>

This is what I have to live with, though:
<?xml version="1.0"?><methodCall><methodName>Add</methodName><params></params></methodCall>

How can I adapt the XmlRpcServlet so that it "forwards" these requests to the right handler class ("Calculator")?

I already tried to add a handler with a empty "pKey"
(
PropertyHandlerMapping phm = new PropertyHandlerMapping();
phm.addHandler("", ex.ample.com.Calculator);
).
That just lead to another error ("org.apache.xmlrpc.XmlRpcException: No such handler: Add") when I tried to send a request to the XmlRpcServlet.

I also read that in XML-RPC 2 it was possible to use a DefaultHandlerMapping. Though, it seems this DefaultHandlerMapping has not been included in the latest release, which I would like to use. Besides, neither the provided information on the XMLRPC2- site nor other sources could really help me to produce some working solution - not even with XML-RPC 2.

I'd be glad to get some example code in the answer.

Kind regards,
Yves Gänßinger


Re: DefaultHandlerMapping in XmlRpcServlet

Posted by Marden john Manawis-Molina <ma...@gmail.com>.
Try giving it a full flash then incorporate it in a new language or codex.

mr. m manawis
On Dec 12, 2013 5:32 AM, "Yves Gänssinger" <Yv...@hiq.se> wrote:

>  Hello!
>
>
>
> We need a servlet which handles XML-RPC requests from a third party. The
> third-party XMLRPC-API had already existed before, meaning the format of
> these incoming requests is fixed and we must adapt to them.
>
>
>
> Unfortunately, these requests only contain a methodName and no handler
> name. Analogue to the calculator-example, the requests would only contain
> “add” as method name, and no “Calculator.add”. To be more precise:
>
>
>
> This is what I could handle without problems right now:
>
> <?xml
> version="1.0"?><methodCall><methodName>Calculator.Add</methodName><params></params></methodCall>
>
>
>
> This is what I have to live with, though:
>
> <?xml
> version="1.0"?><methodCall><methodName>Add</methodName><params></params></methodCall>
>
>
>
> How can I adapt the XmlRpcServlet so that it “forwards” these requests to
> the right handler class (“Calculator”)?
>
>
>
> I already tried to add a handler with a empty “pKey”
>
> (
>
> *PropertyHandlerMapping* phm = *new* PropertyHandlerMapping();
>
> phm.addHandler("", ex.ample.com.Calculator);
>
> ).
>
> That just lead to another error (“*org.apache.xmlrpc.XmlRpcException*: No
> such handler: Add”) when I tried to send a request to the XmlRpcServlet.
>
>
>
> I also read that in XML-RPC 2 it was possible to use a
> DefaultHandlerMapping. Though, it seems this DefaultHandlerMapping has not
> been included in the latest release, which I would like to use. Besides,
> neither the provided information on the XMLRPC2- site nor other sources
> could really help me to produce some working solution – not even with
> XML-RPC 2.
>
>
>
> I’d be glad to get some example code in the answer.
>
>
>
> Kind regards,
>
> Yves Gänßinger
>
>
>

Re: DefaultHandlerMapping in XmlRpcServlet

Posted by Marden john Manawis-Molina <ma...@gmail.com>.
Try giving it a full flash and incorporste a new language to connect.

mr. m manawis
On Dec 12, 2013 5:32 AM, "Yves Gänssinger" <Yv...@hiq.se> wrote:

>  Hello!
>
>
>
> We need a servlet which handles XML-RPC requests from a third party. The
> third-party XMLRPC-API had already existed before, meaning the format of
> these incoming requests is fixed and we must adapt to them.
>
>
>
> Unfortunately, these requests only contain a methodName and no handler
> name. Analogue to the calculator-example, the requests would only contain
> “add” as method name, and no “Calculator.add”. To be more precise:
>
>
>
> This is what I could handle without problems right now:
>
> <?xml
> version="1.0"?><methodCall><methodName>Calculator.Add</methodName><params></params></methodCall>
>
>
>
> This is what I have to live with, though:
>
> <?xml
> version="1.0"?><methodCall><methodName>Add</methodName><params></params></methodCall>
>
>
>
> How can I adapt the XmlRpcServlet so that it “forwards” these requests to
> the right handler class (“Calculator”)?
>
>
>
> I already tried to add a handler with a empty “pKey”
>
> (
>
> *PropertyHandlerMapping* phm = *new* PropertyHandlerMapping();
>
> phm.addHandler("", ex.ample.com.Calculator);
>
> ).
>
> That just lead to another error (“*org.apache.xmlrpc.XmlRpcException*: No
> such handler: Add”) when I tried to send a request to the XmlRpcServlet.
>
>
>
> I also read that in XML-RPC 2 it was possible to use a
> DefaultHandlerMapping. Though, it seems this DefaultHandlerMapping has not
> been included in the latest release, which I would like to use. Besides,
> neither the provided information on the XMLRPC2- site nor other sources
> could really help me to produce some working solution – not even with
> XML-RPC 2.
>
>
>
> I’d be glad to get some example code in the answer.
>
>
>
> Kind regards,
>
> Yves Gänßinger
>
>
>