You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@ws.apache.org by Peter Guy <pg...@vrcis.com> on 2005/09/28 23:11:39 UTC
XML-RPC server - accessing the body of the request
Forgive me if this question has already been asked and answered. I do not
have easy access to an mbox decoding utility, thus cannot readily search the
archives. Are the archives kept elsewhere in a different format?
I am using the apache XML-RPC server to implement a fairly simple web
service.
I have the basics down and have compiled a test server and client that
appear to work well.
The only thing I haven't been able to figure out how to do (w/out modifying
the source) is to access the request body from a handler method.
For example, here's my test server:
public class testXMLRPC{
public testXMLRPC(){
}
public String HelloWorld(String subject){
return "Hello " + subject;
}
public static void main(String[] args){
try{
XmlRpc.setDebug(true);
WebServer server = new WebServer(8080);
server.addHandler("testing", new testXMLRPC());
server.start();
}catch(Exception ex){
System.out.println("Encountered Exception");
ex.printStackTrace(System.out);
}
}
}
Really quite simple.
Sending the following xml request to the server will return the string,
"Hello World!":
<?xml version="1.0"?>
<methodCall>
<methodName>testing.HelloWorld</methodName>
<params>
<param>
<value><string>World!</string></value>
</param>
</params>
</methodCall>
Now, in the "HelloWorld" method, I'd like to have access to the above xml.
Do you understand what I mean?
Is that possible?
Thanks,
-Peter