panda.net.xmlrpc.XmlRpcClient Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of panda-core Show documentation
Show all versions of panda-core Show documentation
Panda Core is the core module of Panda Framework, it contains commonly used utility classes similar to apache-commons.
package panda.net.xmlrpc;
import java.io.IOException;
import java.lang.reflect.Type;
import java.util.List;
import panda.bind.xmlrpc.XmlRpcDocument;
import panda.bind.xmlrpc.XmlRpcs;
import panda.cast.Castors;
import panda.io.MimeTypes;
import panda.io.Streams;
import panda.lang.Arrays;
import panda.lang.Strings;
import panda.lang.time.StopWatch;
import panda.log.Log;
import panda.log.Logs;
import panda.net.http.HttpClient;
import panda.net.http.HttpRequest;
import panda.net.http.HttpResponse;
public class XmlRpcClient {
private static final Log log = Logs.getLog(XmlRpcClient.class);
private Castors castors;
private HttpClient http;
private String url;
private String userAgent;
/**
* @param url the Xml-Rpc EntryPoint URL
*/
public XmlRpcClient(String url) {
this.url = url;
castors = Castors.i();
http = new HttpClient();
}
/**
* @return the url
*/
public String getUrl() {
return url;
}
/**
* @param url the url to set
*/
public void setUrl(String url) {
this.url = url;
}
/**
* @return the userAgent
*/
public String getUserAgent() {
return userAgent;
}
/**
* @param userAgent the userAgent to set
*/
public void setUserAgent(String userAgent) {
this.userAgent = userAgent;
}
public T call(String method, Type resultType, Object... params) throws XmlRpcFaultException, IOException {
XmlRpcDocument