Examples of XmlRpcStreamRequestConfig


Examples of org.apache.xmlrpc.common.XmlRpcStreamRequestConfig

  /** 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>"
View Full Code Here

Examples of org.apache.xmlrpc.common.XmlRpcStreamRequestConfig

  /** Test serialization of a byte array.
   * @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>"
View Full Code Here

Examples of org.apache.xmlrpc.common.XmlRpcStreamRequestConfig

  public void testMapParam() throws Exception {
    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>"
View Full Code Here

Examples of org.apache.xmlrpc.common.XmlRpcStreamRequestConfig

        cal1.set(1933, 5, 12, 11, 7, 21);
        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\">"
View Full Code Here

Examples of org.apache.xmlrpc.common.XmlRpcStreamRequestConfig

  /** 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\">"
View Full Code Here

Examples of org.apache.xmlrpc.common.XmlRpcStreamRequestConfig

  /** 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>"
View Full Code Here

Examples of org.apache.xmlrpc.common.XmlRpcStreamRequestConfig

  /** Test serialization of a byte array.
   * @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>"
View Full Code Here

Examples of org.apache.xmlrpc.common.XmlRpcStreamRequestConfig

  public void testMapParam() throws Exception {
    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>"
View Full Code Here

Examples of org.apache.xmlrpc.common.XmlRpcStreamRequestConfig

  protected boolean isUsingByteArrayOutput(XmlRpcStreamRequestConfig pConfig) {
    return false;
  }

  public Object sendRequest(XmlRpcRequest pRequest) throws XmlRpcException {
    XmlRpcStreamRequestConfig config = (XmlRpcStreamRequestConfig) pRequest.getConfig();
    Object connection = newConnection(config);
    try {
      initConnection(config, connection);
      OutputStream ostream;
      ByteArrayOutputStream baos;
      if (isUsingByteArrayOutput(config)) {
        baos = new ByteArrayOutputStream();
        if (config.isGzipCompressing()) {
          try {
            ostream = new GZIPOutputStream(baos);
          } catch (IOException e) {
            throw new XmlRpcClientException("Failed to create GZIPOutputStream: " + e.getMessage(), e);
          }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.