Getting Problem in Using XML-RPC Parser

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

Getting Problem in Using XML-RPC Parser

Postby shaamu786 » Thu Jan 28, 2010 1:19 am

Hi,

I am using XML-RPC parser for Android SDK 1.5. Here is the link from where i downloaded the code

http://www.anddev.org/web_services_-_an_xml-rpc_client_for_android-t646.html


But the problem is that given classes are deprecated from SDK 1.5 which used in the above code...

android.net.http.EventHandler;
android.net.http.Headers;
android.net.http.RequestQueue;

so tell me how i replace these classes for SDK 1.5

If have any idea please share with me....


Thanks.
xgw
shaamu786
Junior Developer
Junior Developer
 
Posts: 16
Joined: Tue Sep 01, 2009 7:17 am
Location: Delhi

Top

Problem with XML-RPC

Postby Nando_madsa » Sat Mar 20, 2010 3:33 pm

Hi all,

I'm getting the same trouble shamu commented, I cannot set up XML-RPC as indicated in the tutorial written by daniel.kick.ass (unable to include the URL because this is my first post ;-) whatever, it is the same commented in the previous post from shamu) because the some of the classes that were included in the package android.net.http are not currently supported in the actual SDK release.

How can I make it works in the current SDK version??
Nando_madsa
Freshman
Freshman
 
Posts: 3
Joined: Sat Mar 20, 2010 3:22 pm

Postby pskink » Sat Mar 20, 2010 5:43 pm

did you try recent version of http://code.google.com/p/android-xmlrpc/ ?
pskink
pskink
Master Developer
Master Developer
 
Posts: 719
Joined: Mon Nov 24, 2008 3:49 pm

Postby Nando_madsa » Sat Mar 20, 2010 9:37 pm

Unfortunately, that idea comes to me after sending my question.

I've already downloaded the project and make it work with ther server included in eclipse. So I do apologize for my stupid question before looking for all the available doc.

By te way, congratulations for your work in the project and thank you very much for sharing it with all people. I hope with the project my group is working on.
Nando_madsa
Freshman
Freshman
 
Posts: 3
Joined: Sat Mar 20, 2010 3:22 pm

Postby Nando_madsa » Wed Mar 31, 2010 10:54 pm

Hi again pskink,

I'm currently working in a server based on Java to make some test functionality por XML-RPC. Basically just as the server.py provided at your project in google code but I need to learn how to implement it in Java for a future application.

Basically I'm getting a nasty exception which, after looking into some webs and forums, I'm not able to fix.

The client part is the same provided in the project and the server is this one:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. import org.apache.xmlrpc.server.PropertyHandlerMapping;
  2. import org.apache.xmlrpc.server.XmlRpcServer;
  3. import org.apache.xmlrpc.webserver.WebServer;
  4.  
  5.  
  6. public class JavaServer {
  7.  
  8.         final static int port = 8080;
  9.        
  10.         public int add(int i1, int i2) {
  11.                 return i1 + i2;
  12.         }
  13.        
  14.         public static void main(String[] args) {
  15.                
  16.                 try {
  17.                         System.out.println("Attempting to start XML-RPC server...");
  18.                         WebServer webServer = new WebServer(port);
  19.                         XmlRpcServer xmlRpcServer = webServer.getXmlRpcServer();
  20.                         PropertyHandlerMapping phm = new PropertyHandlerMapping();
  21.                         phm.addHandler("add", JavaServer.class);
  22.                         xmlRpcServer.setHandlerMapping(phm);
  23.                         webServer.start();
  24.                 } catch (Exception ex) {
  25.                         ex.printStackTrace();
  26.                 }
  27.                
  28.         }
  29.        
  30. }
  31.  
Parsed in 0.033 seconds, using GeSHi 1.0.8.4


The stack I'm getting printed after making with the client the first request, the one of the sum, is:

31-mar-2010 23:31:07 org.apache.xmlrpc.server.XmlRpcErrorLogger log
GRAVE: No such handler: add
org.apache.xmlrpc.server.XmlRpcNoSuchHandlerException: No such handler: add
at org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping.getHandler(AbstractReflectiveHandlerMapping.java:214)
at org.apache.xmlrpc.server.XmlRpcServerWorker.execute(XmlRpcServerWorker.java:45)
at org.apache.xmlrpc.server.XmlRpcServer.execute(XmlRpcServer.java:86)
at org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcStreamServer.java:200)
at org.apache.xmlrpc.webserver.Connection.run(Connection.java:208)
at org.apache.xmlrpc.util.ThreadPool$Poolable$1.run(ThreadPool.java:68)
31-mar-2010 23:31:54 org.apache.xmlrpc.server.XmlRpcErrorLogger log


Which handler I'm supposed to add to my server??

Of course, I will be very grateful if you comment to me any mistake or something you think I need to improve in my code.

Thank you very much for your help, best regards

Fernando.
Nando_madsa
Freshman
Freshman
 
Posts: 3
Joined: Sat Mar 20, 2010 3:22 pm

Top

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 7 guests