简体   繁体   中英

Generate XML-RPC as String in Java

This is what I want to do: I have a method name and parameter types and I want to have the XML-RPC as a String (and not send it!).

Like this... String someGreatThing.generate("bla.doStuff", String, int) and this is what I want to have then:

<?xml version="1.0"?>
 <methodCall>
   <methodName>bla.doStuff</methodName>
   <params>
     <param>
       <value><string></string></value>
     </param>
     <param>
       <value><int></int></value>
     </param>
   </params>
 </methodCall>

I just need the String.

Any idea if some library can do that? Preferably the XML-RPC libs from Apache, because I use them anyway.

Thank you!

You can do something like that with XStream: http://x-stream.github.io/ . But it is more general purpose, not XML-RPC specific.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM