XMLRPC中的android错误额外参数

时间:2014-11-03 03:22:55

标签: android xml-rpc

当我将参数传递给调用服务器时,我遇到了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:xmlrpc错误:对象引用未设置为对象的实例”

我必须做什么?

1 个答案:

答案 0 :(得分:0)

交叉检查您的XMLRPC连接是否为空

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

 if(client != null){

   //your code here
 }