Package org.apache.xmlrpc.client

Examples of org.apache.xmlrpc.client.XmlRpcClientRequestImpl


    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


        cal1.set(Calendar.MILLISECOND, 311);
        Calendar cal2 = Calendar.getInstance(TimeZone.getDefault());
        cal2.set(1933, 5, 12, 11, 7, 21);
        cal2.set(Calendar.MILLISECOND, 311);
        XmlRpcStreamRequestConfig config = getExConfig();
        XmlRpcRequest request = new XmlRpcClientRequestImpl(config, "dateParam", new Object[]{cal1, cal2.getTime()});
        String got = writeRequest(config, request);
        String expect =
            "<?xml version=\"1.0\" encoding=\"US-ASCII\"?>"
            + "<methodCall xmlns:ex=\"http://ws.apache.org/xmlrpc/namespaces/extensions\">"
            + "<methodName>dateParam</methodName><params>"
View Full Code Here

  /** Test serialization of a byte parameter.
   * @throws Exception The test failed.
   */
  public void testByteParam() throws Exception {
    XmlRpcStreamRequestConfig config = getExConfig();
    XmlRpcRequest request = new XmlRpcClientRequestImpl(config, "byteParam", new Object[]{new Byte((byte)3)});
    String got = writeRequest(config, request);
    String expect =
      "<?xml version=\"1.0\" encoding=\"US-ASCII\"?>"
      + "<methodCall xmlns:ex=\"http://ws.apache.org/xmlrpc/namespaces/extensions\">"
      + "<methodName>byteParam</methodName><params><param><value><ex:i1>3</ex:i1></value></param></params></methodCall>";
View Full Code Here

  /** 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

        cal1.set(Calendar.MILLISECOND, 311);
        Calendar cal2 = Calendar.getInstance(TimeZone.getDefault());
        cal2.set(1933, 5, 12, 11, 7, 21);
        cal2.set(Calendar.MILLISECOND, 311);
        XmlRpcStreamRequestConfig config = getExConfig();
        XmlRpcRequest request = new XmlRpcClientRequestImpl(config, "dateParam", new Object[]{cal1, cal2.getTime()});
        String got = writeRequest(config, request);
        String expect =
            "<?xml version=\"1.0\" encoding=\"US-ASCII\"?>"
            + "<methodCall xmlns:ex=\"http://ws.apache.org/xmlrpc/namespaces/extensions\">"
            + "<methodName>dateParam</methodName><params>"
View Full Code Here

     */
    public void testIntegerKeyMap() throws Exception {
        Map map = new HashMap();
        map.put(new Integer(1), "one");
        XmlRpcStreamRequestConfig config = getExConfig();
        XmlRpcRequest request = new XmlRpcClientRequestImpl(config, "integerKeyMap", new Object[]{map});
        String got = writeRequest(config, request);
        String expect =
            "<?xml version=\"1.0\" encoding=\"US-ASCII\"?>"
            + "<methodCall xmlns:ex=\"http://ws.apache.org/xmlrpc/namespaces/extensions\">"
            + "<methodName>integerKeyMap</methodName><params>"
View Full Code Here

        XmlRpcClientConfigImpl config = getConfig(pProvider);
        client.setConfig(config);
        TypeFactory typeFactory = getCustomDateTypeFactory(client, format);
        client.setTypeFactory(typeFactory);
        Calendar cal1 = Calendar.getInstance();
        XmlRpcRequest request = new XmlRpcClientRequestImpl(config, "DateConverter.tomorrow", new Object[]{cal1.getTime()});
        final String got = XmlRpcTestCase.writeRequest(client, request);
        final String expect = "<?xml version=\"1.0\" encoding=\"US-ASCII\"?>"
            + "<methodCall><methodName>DateConverter.tomorrow</methodName>"
            + "<params><param><value><dateTime.iso8601>" + format.format(cal1.getTime())
            + "</dateTime.iso8601></value></param></params></methodCall>";
View Full Code Here

  /** Test serialization of a byte parameter.
   * @throws Exception The test failed.
   */
  public void testByteParam() throws Exception {
    XmlRpcStreamRequestConfig config = getExConfig();
    XmlRpcRequest request = new XmlRpcClientRequestImpl(config, "byteParam", new Object[]{new Byte((byte)3)});
    String got = writeRequest(config, request);
    String expect =
      "<?xml version=\"1.0\" encoding=\"US-ASCII\"?>"
      + "<methodCall xmlns:ex=\"http://ws.apache.org/xmlrpc/namespaces/extensions\">"
      + "<methodName>byteParam</methodName><params><param><value><ex:i1>3</ex:i1></value></param></params></methodCall>";
View Full Code Here

TOP

Related Classes of org.apache.xmlrpc.client.XmlRpcClientRequestImpl

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.