- protected String send(JSArray args, HTTP http) throws JS.Exn, IOException {
- StringBuffer content = new StringBuffer();
- content.append("\r\n");
- content.append("<?xml version=\"1.0\"?>\n");
- content.append(" <methodCall>\n");
- content.append(" <methodName>");
- content.append(methodname);
- content.append("</methodName>\n");
- content.append(" <params>\n");
- for(int i=0; i<args.length(); i++) {
- content.append(" <param>\n");
- appendObject(args.elementAt(i), content);
- content.append(" </param>\n");
- }
- content.append(" </params>\n");
- content.append(" </methodCall>");
- return content.toString();
- }
-
- protected Object recieve(BufferedReader br) throws JS.Exn, IOException {
- // parse XML reply
- try {
- new Helper().parse(br);
- } catch (XML.XMLException e) {
- if (Log.on) Log.log(this, "reply from server was not well-formed XML: " + e);
- throw new JS.Exn("reply from server was not well-formed XML: " + e);
- }
-
- if (fault) throw new JS.Exn(objects.elementAt(0));
- if (objects.size() == 0) return null;
- return objects.elementAt(0);
- }