我想通过我的 Android 应用程序向我的 OpenErp (Odoo 9) 发送数据(只是名称的名称)。我创建了一个模块,并成功插入到我的 Odoo 帐户中,它只有“名称”字段。但我在 Android Studio 中有这个问题:
无法访问 XmlRpcController ,XmlRpcHttpRequestConfig !
Button click ;
static final String TAG = "OERP";
final String url = "l";
final String db = "database";
final String username = "admin";
final String password = "123";
static final XmlRpcClient client = new XmlRpcClient();
static final XmlRpcClientConfigImpl common_config = new XmlRpcClientConfigImpl();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
click=(Button)findViewById( R.id.button);
View.OnClickListener l=new View.OnClickListener() {
@Override
public void onClick(View v) {
try{
Map emptyMap = Collections.emptyMap();
**/*first error*/** common_config.setServerURL(
new URL(String.format("%s/xmlrpc/2/common", url)));
**/*second error*/** int uid = (int) client.execute(
common_config, "authenticate", asList(
db, username, password, emptyMap));
**/*third error*/** final XmlRpcClient models = new XmlRpcClient() {{
setConfig(new XmlRpcClientConfigImpl() {{
setServerURL(new URL(String.format("%s/xmlrpc/2/object", url)));
}});
}};
final Integer id = (Integer) models.execute("execute_kw", asList(
db, uid, password,
"pointage.task", "create",
asList(new HashMap() {{
put("name", "New Partner");
}})
));
} catch (MalformedURLException e){
Log.e(TAG,"/ :: "+e.getMessage(),e);
}
}
};click.setOnClickListener(l);
}
}
这是我的日志:
错误:(60, 19) 错误:无法访问 org.apache.xmlrpc.common.XmlRpcHttpRequestConfig 的 XmlRpcHttpRequestConfig 类文件未找到
Error:(62, 28) error: cannot access XmlRpcHttpRequestConfigImpl class file for
org.apache.xmlrpc.common.XmlRpcHttpRequestConfigImpl not foundError:(67, 34) error: cannot access XmlRpcController class file for org.apache.xmlrpc.common.XmlRpcController not found