Package org.apache.xmlrpc.client

Examples of org.apache.xmlrpc.client.XmlRpcClientException


        try {
            xp = new XmlRpcResponseParser(xmlRpcStreamRequestConfig, typeFactory);
            xr.setContentHandler(xp);
            xr.parse(isource);
        } catch (SAXException e) {
            throw new XmlRpcClientException("Failed to parse server's response: " + e.getMessage(), e);
        } catch (IOException e) {
            throw new XmlRpcClientException("Failed to read server's response: " + e.getMessage(), e);
        }
        if (xp.isSuccess()) {
            return xp.getResult();
        }
        Throwable t = xp.getErrorCause();
View Full Code Here


        try {
            xp = new XmlRpcRequestParser(xmlRpcStreamRequestConfig, typeFactory);
            xr.setContentHandler(xp);
            xr.parse(isource);
        } catch (SAXException e) {
            throw new XmlRpcClientException("Failed to parse server's response: " + e.getMessage(), e);
        } catch (IOException e) {
            throw new XmlRpcClientException("Failed to read server's response: " + e.getMessage(), e);
        }
        return new XmlRpcRequestImpl(xp.getMethodName(), xp.getParams());

    }
View Full Code Here

          e = ex;
        }
      }
    }
    if (e != null) {
      throw new XmlRpcClientException("Failed to close connection: " + e.getMessage(), e);
    }
  }
View Full Code Here

      String statusMsg = tokens.nextToken("\n\r");
      final int code;
      try {
          code = Integer.parseInt(statusCode);
      } catch (NumberFormatException e) {
                throw new XmlRpcClientException("Server returned invalid status code: "
                        + statusCode + " " + statusMsg, null);
      }
      if (code < 200  ||  code > 299) {
            throw new XmlRpcHttpTransportException(code, statusMsg);
        }
      int contentLength = -1;
      for (;;) {
        line = HttpUtil.readLine(input, buffer);
        if (line == null  ||  "".equals(line)) {
          break;
        }
        line = line.toLowerCase();
        if (line.startsWith("content-length:")) {
          contentLength = Integer.parseInt(line.substring("content-length:".length()).trim());
        } else if (line.startsWith("content-encoding:")) {
          responseGzipCompressed = HttpUtil.isUsingGzipEncoding(line.substring("content-encoding:".length()));
        }
      }
      InputStream result;
      if (contentLength == -1) {
        result = input;
      } else {
        result = new LimitedInputStream(input, contentLength);
      }
      return result;
    } catch (IOException e) {
      throw new XmlRpcClientException("Failed to read server response: " + e.getMessage(), e);
    }
  }
View Full Code Here

        try {
            xp = new XmlRpcResponseParser(config, typeFactory);
            xr.setContentHandler(xp);
            xr.parse(isource);
        } catch (SAXException e) {
            throw new XmlRpcClientException("Failed to parse server's response: " + e.getMessage(), e);
        } catch (IOException e) {
            throw new XmlRpcClientException("Failed to read server's response: " + e.getMessage(), e);
        }
        if (xp.isSuccess()) {
            return xp.getResult();
        }
        Throwable t = xp.getErrorCause();
View Full Code Here

        try {
            xp = new XmlRpcRequestParser(config, typeFactory);
            xr.setContentHandler(xp);
            xr.parse(isource);
        } catch (SAXException e) {
            throw new XmlRpcClientException("Failed to parse server's response: " + e.getMessage(), e);
        } catch (IOException e) {
            throw new XmlRpcClientException("Failed to read server's response: " + e.getMessage(), e);
        }
        return new XmlRpcRequestImpl(xp.getMethodName(), xp.getParams());

    }
View Full Code Here

TOP

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

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.