android中的XMLRPC错误额外参数
当我传递参数来调用服务器时,XMLRPC有问题android中的XMLRPC错误额外参数,android,xml-rpc,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", add
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();
}
JSONObject s_profile=new JSONObject();
s_profile.put(“令牌”,令牌ID);
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(“手机”,mobile.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=新的XMLRPCClient(Config.urlApi);
试一试{
obj=(HashMap)client.call(“requestUpdatePatientProfile”,s_profile.toString());
}捕获(XMLRPCException e){
//TODO自动生成的捕捉块
e、 printStackTrace();
}
我得到的错误是“org.xmlrpc.android.xmlrpc故障:xmlrpc故障:对象引用未设置为对象的实例”
我必须这样做吗?交叉检查您的XMLRPC连接是否为空
//..
XMLRPCClient client = new XMLRPCClient(Config.urlApi);
if(client != null){
//your code here
}