안드로이드 개발 질문/답변
(글 수 45,052)
안드로이드에서 xml-rpc 사용할수 있나요??
테스트 해볼려고 XMLRPCServerService 구성하고
안드로이드에서 client 시험하기 위해
TextView tv = (TextView)findViewById(R.id.text);
XmlRpcClient client = new XmlRpcClient();
XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
try {
URL SERVER_URL = new URL("http://192.168.0.205/xmlrpc");
config.setBasicEncoding("utf-8");
config.setServerURL(SERVER_URL);
client.setConfig(config);
} catch (MalformedURLException e) {
e.printStackTrace();
}
try {
Object[] params = new Object[] { new Integer(5), new Integer(3) };
Integer result = (Integer)client.execute("Android.add", params);
tv.setText("5 + 3 = " + result);
} catch (XmlRpcException e) {
e.printStackTrace();
}
이렇게 작성해봤는데요.. 빨간색 부분에서 예외가 발생하네요...
org.apache.xmlrpc.XmlRpcException:"Unable to create XML parser: org.xml.sax.SAXNotRecognizedException:
http://xml.org/sax/features/external-parameter-entities" (id=830082384000)
메시지는 위와 같은데 어떻게 해야할지 모르겠네요... 해결 방법이 있을까요??
테스트 해볼려고 XMLRPCServerService 구성하고
안드로이드에서 client 시험하기 위해
TextView tv = (TextView)findViewById(R.id.text);
XmlRpcClient client = new XmlRpcClient();
XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
try {
URL SERVER_URL = new URL("http://192.168.0.205/xmlrpc");
config.setBasicEncoding("utf-8");
config.setServerURL(SERVER_URL);
client.setConfig(config);
} catch (MalformedURLException e) {
e.printStackTrace();
}
try {
Object[] params = new Object[] { new Integer(5), new Integer(3) };
Integer result = (Integer)client.execute("Android.add", params);
tv.setText("5 + 3 = " + result);
} catch (XmlRpcException e) {
e.printStackTrace();
}
이렇게 작성해봤는데요.. 빨간색 부분에서 예외가 발생하네요...
org.apache.xmlrpc.XmlRpcException:"Unable to create XML parser: org.xml.sax.SAXNotRecognizedException:
http://xml.org/sax/features/external-parameter-entities" (id=830082384000)
메시지는 위와 같은데 어떻게 해야할지 모르겠네요... 해결 방법이 있을까요??
http://code.google.com/p/android-xmlrpc/ 에서 해결했습니다.