2014-11-03 52 views
0

当我传递参数来调用服务器时,我有XMLRPC的问题。在android中的XMLRPC错误额外的参数

JSONObject s_profile = new JSONObject(); 
    s_profile.put("token", tokenId); 
    s_profile.put("lname", Fname.getText().toString()); 
    s_profile.put("lname", Lname.getText().toString()); 
    s_profile.put("address", address.getText().toString()); 
    s_profile.put("city", city.getText().toString()); 
    s_profile.put("state", state.getText().toString()); 
    s_profile.put("homePhone", homephone.getText().toString()); 
    s_profile.put("cellphone", cellphone.getText().toString()); 
    s_profile.put("zipcode", zipcode.getText().toString()); 
    s_profile.put("contactname", contact.getText().toString()); 
    s_profile.put("contactphone", phone.getText().toString()); 
    XMLRPCClient client = new XMLRPCClient(Config.urlApi); 
    try { 

     obj = (HashMap<String, String>) client.call("requestUpdatePatientProfile",s_profile.toString()); 

    } catch (XMLRPCException e) { 
      // TODO Auto-generated catch block 
     e.printStackTrace(); 
    } 

我得到的错误是“org.xmlrpc.android.xmlrpcfault:XML-RPC错误:对象引用不设置到对象的实例”

我必须做什么?

回答

0

交叉检查你的XML-RPC连接不为空

//.. 
XMLRPCClient client = new XMLRPCClient(Config.urlApi); 

if(client != null){ 

    //your code here 
}