XMLRPC help

Put your problem here if it does not fit any of the other categories.

XMLRPC help

Postby Kevin.A » Sun Dec 06, 2009 11:17 pm

I'm new to Web Coding. I have a simple xmlrpc server up and running. i can make calls to it, and can even get data, assuming the data returns one object in the array.
This is the return that works
Code: Select all
$struct = array( 'good'=> new xmlrpcval('true', 'string'));
return new xmlrpcresp(new xmlrpcval($struct,'struct'));

This one does not
Code: Select all
$struct = array('id'=> new xmlrpcval($row[0], 'string'), 'timeupdated'=> new xmlrpcval($row[1], 'string'),'artist'=> new xmlrpcval($row[2], 'string'), 'album'=> new xmlrpcval($row[3], 'string'), 'title'=> new xmlrpcval($row[4],string'), 'etime'=> new xmlrpcval($row[5], 'string'), 'tottime'=> new xmlrpcval($row[6],string'));
return new xmlrpcresp(new xmlrpcval($struct,'struct'));


The second return works for my simple python client i wrote for testing.

Here's my android code for that second function:
Code: Select all
public int getSongInfo() {
try {
  Hashtable SongInfo = (Hashtable) client.call("rhythm.getSongInfo", "ANDROID");
  String Artest = ((String) SongInfo.get("artest")).toString();
  Log.v("SongTest", Artest);
} catch (Exception e) {
  Log.e("SongInfo","Nay, did not work");
  Log.e("SongInfo",e.getMessage());
  return 1;
}


This is the error i get
Code: Select all
org.xmlpull.v1.XmlPullParserException: PI must not start with xml (position:unkown Array)
(
   [0] => 303795
   ...
   [8[ => ANDROID
)
@13:5 in java.io.InputStreamReader@43b2d858)


Am i doing something wrong in the php server or something wrong in my java?

Also i'm using pskink's slim XML-RPC from slim_xml-rpc-t3800.html

I've been doing java for less then a week, so if it's a stupid problem, i apologize.

Thanks for your help
Kevin
Kevin.A
Freshman
Freshman
 
Posts: 7
Joined: Sun Dec 06, 2009 6:58 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 13 guests