Package org.apache.xmlrpc

Examples of org.apache.xmlrpc.XmlRpcRequest


  /** Test serialization of an integer parameter.
   * @throws Exception The test failed.
   */
  public void testIntParam() throws Exception {
    XmlRpcStreamRequestConfig config = getConfig();
    XmlRpcRequest request = new XmlRpcClientRequestImpl(config, "intParam", new Object[]{new Integer(3)});
    String got = writeRequest(config, request);
    String expect =
      "<?xml version=\"1.0\" encoding=\"US-ASCII\"?>"
      + "<methodCall>"
      + "<methodName>intParam</methodName><params><param><value><i4>3</i4></value></param></params></methodCall>";
View Full Code Here


   * @throws Exception The test failed.
   */
  public void testByteArrayParam() throws Exception {
    byte[] bytes = new byte[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
    XmlRpcStreamRequestConfig config = getConfig();
    XmlRpcRequest request = new XmlRpcClientRequestImpl(config, "byteArrayParam", new Object[]{bytes});
    String got = writeRequest(config, request);
    String expect =
      "<?xml version=\"1.0\" encoding=\"US-ASCII\"?>"
      + "<methodCall>"
      + "<methodName>byteArrayParam</methodName><params><param><value><base64>AAECAwQFBgcICQ==</base64></value></param></params></methodCall>";
View Full Code Here

    final Map map = new HashMap();
    map.put("2", new Integer(3));
    map.put("3", new Integer(5));
    final Object[] params = new Object[]{map};
    XmlRpcStreamRequestConfig config = getConfig();
    XmlRpcRequest request = new XmlRpcClientRequestImpl(config, "mapParam", params);
    String got = writeRequest(config, request);
    String expect =
      "<?xml version=\"1.0\" encoding=\"US-ASCII\"?>"
      + "<methodCall><methodName>mapParam</methodName>"
      + "<params><param><value><struct>"
View Full Code Here

TOP

Related Classes of org.apache.xmlrpc.XmlRpcRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.