Package org.apache.xmlrpc.common

Examples of org.apache.xmlrpc.common.XmlRpcStreamRequestConfig


    protected abstract void writeRequest(ReqWriter pWriter)
        throws XmlRpcException, IOException, SAXException;
   
  public Object sendRequest(XmlRpcRequest pRequest) throws XmlRpcException {
    XmlRpcStreamRequestConfig config = (XmlRpcStreamRequestConfig) pRequest.getConfig();
    boolean closed = false;
    try {
            ReqWriter reqWriter = newReqWriter(pRequest);
      writeRequest(reqWriter);
      InputStream istream = getInputStream();
View Full Code Here


    return parseResponse(new InputSource(new StringReader(s)));
  }

    private Object parseResponse(InputSource isource) throws XmlRpcException,
            IOException, SAXException {
        XmlRpcStreamRequestConfig config = new XmlRpcClientConfigImpl();
    XmlRpcClient client = new XmlRpcClient();
    XmlRpcResponseParser parser = new XmlRpcResponseParser(config, client.getTypeFactory());
    XMLReader xr = SAXParsers.newXMLReader();
    xr.setContentHandler(parser);
        xr.parse(isource);
View Full Code Here

  }

  protected void writeRequest(RequestWriter pWriter) throws XmlRpcException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();   
    pWriter.write(baos);
    XmlRpcStreamRequestConfig config = (XmlRpcStreamRequestConfig) pWriter.getRequest().getConfig();
    conn = new LocalStreamConnection(config, new ByteArrayInputStream(baos.toByteArray()));
  }
View Full Code Here

    return pConfig.isEnabledForExtensions()
      && pConfig.isGzipCompressing();
  }

  public Object sendRequest(XmlRpcRequest pRequest) throws XmlRpcException {
    XmlRpcStreamRequestConfig config = (XmlRpcStreamRequestConfig) pRequest.getConfig();
    boolean closed = false;
    try {
      RequestWriter writer = newRequestWriter(pRequest);
      writeRequest(writer);
      InputStream istream = getInputStream();
View Full Code Here

    /** Writes the requests XML data to the given output stream,
     * possibly compressing it. Ensures, that the output stream
     * is being closed.
     */
    protected void write(OutputStream pStream) throws XmlRpcException {
      XmlRpcStreamRequestConfig config = (XmlRpcStreamRequestConfig) request.getConfig();
      if (isCompressingRequest(config)) {
        try {
          GZIPOutputStream gStream = new GZIPOutputStream(pStream);
          writeUncompressed(gStream);
          pStream.close();
View Full Code Here

    protected abstract void writeRequest(ReqWriter pWriter)
        throws XmlRpcException, IOException, SAXException;
   
  public Object sendRequest(XmlRpcRequest pRequest) throws XmlRpcException {
    XmlRpcStreamRequestConfig config = (XmlRpcStreamRequestConfig) pRequest.getConfig();
    boolean closed = false;
    try {
            ReqWriter reqWriter = newReqWriter(pRequest);
      writeRequest(reqWriter);
      InputStream istream = getInputStream();
View Full Code Here

    protected void writeRequest(ReqWriter pWriter)
            throws XmlRpcException, IOException, SAXException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();   
    pWriter.write(baos);
    XmlRpcStreamRequestConfig config = (XmlRpcStreamRequestConfig) request.getConfig();
    conn = new LocalStreamConnection(config, new ByteArrayInputStream(baos.toByteArray()));
  }
View Full Code Here

    protected abstract void writeRequest(ReqWriter pWriter)
        throws XmlRpcException, IOException, SAXException;
   
  public Object sendRequest(XmlRpcRequest pRequest) throws XmlRpcException {
    XmlRpcStreamRequestConfig config = (XmlRpcStreamRequestConfig) pRequest.getConfig();
    boolean closed = false;
    try {
            ReqWriter reqWriter = newReqWriter(pRequest);
      writeRequest(reqWriter);
      InputStream istream = getInputStream();
View Full Code Here

/** Test for the various parsers.
*/
public class ParserTest extends TestCase {
  private Object parseResponse(final String s) throws XmlRpcException, IOException, SAXException, SAXParseException {
    XmlRpcStreamRequestConfig config = new XmlRpcClientConfigImpl();
    XmlRpcClient client = new XmlRpcClient();
    XmlRpcResponseParser parser = new XmlRpcResponseParser(config, client.getTypeFactory());
    XMLReader xr = SAXParsers.newXMLReader();
    xr.setContentHandler(parser);
    try {
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\">"
View Full Code Here

TOP

Related Classes of org.apache.xmlrpc.common.XmlRpcStreamRequestConfig

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.