xmlRpcArray.add(new XmlRpcString("Luke"));
xmlRpcArray.add(new XmlRpcString("Leia"));
XmlRpcElement[] parameters = { xmlRpcArray };
XmlRpcRequest expected = new XmlRpcRequest(this.serviceName,
this.methodName, parameters);
StringBuffer builder = new StringBuffer();
builder.append("<?xml version=\"1.0\"?>");
builder.append("<methodCall><methodName>");
builder.append(this.serviceAndMethodNames);
builder.append("</methodName><params><param><value><array><data>");
XmlRpcElement[] elements = xmlRpcArray.getElements();
int memberCount = elements.length;
for (int i = 0; i < memberCount; i++) {
XmlRpcString element = (XmlRpcString) elements[i];
builder.append("<value>");
builder.append(element.getValue());
builder.append("</value>");
}
builder.append("</data></array></value></param></params></methodCall>");
String request = builder.toString();
InputStream inputStream = new ByteArrayInputStream(request.getBytes());
XmlRpcRequest actual = this.parser.parseRequest(inputStream);
this.logger.info("XML-RPC request: " + request);
this.logger.info(actual);
assertEquals("<XML-RPC request>", expected, actual);