Examples of XmlRpcRequestParser


Examples of org.apache.xmlrpc.parser.XmlRpcRequestParser

    }
   
    protected Object unmarshalRequest(Exchange exchange, InputStream stream) throws Exception {
        InputSource isource = new InputSource(stream);
        XMLReader xr = newXMLReader();
        XmlRpcRequestParser xp;
        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

Examples of org.apache.xmlrpc.parser.XmlRpcRequestParser

    spf.setValidating(false);
  }

  protected XmlRpcRequest getRequest(final XmlRpcStreamRequestConfig pConfig,
                     InputStream pStream) throws XmlRpcException {
    final XmlRpcRequestParser parser = new XmlRpcRequestParser(pConfig, getTypeFactory());
    final XMLReader xr;
    try {
      xr = spf.newSAXParser().getXMLReader();
    } catch (ParserConfigurationException e) {
      throw new XmlRpcException("Unable to create XML parser: " + e.getMessage(), e);
    } catch (SAXException e) {
      throw new XmlRpcException("Unable to create XML parser: " + e.getMessage(), e);
    }
    xr.setContentHandler(parser);
    try {
      xr.parse(new InputSource(pStream));
    } catch (SAXException e) {
      Exception ex = e.getException();
      if (ex != null  &&  ex instanceof XmlRpcException) {
        throw (XmlRpcException) ex;
      }
      throw new XmlRpcException("Failed to parse XML-RPC request: " + e.getMessage(), e);
    } catch (IOException e) {
      throw new XmlRpcException("Failed to read XML-RPC request: " + e.getMessage(), e);
    }
    final List params = parser.getParams();
    return new XmlRpcRequest(){
      public XmlRpcRequestConfig getConfig() { return pConfig; }
      public String getMethodName() { return parser.getMethodName(); }
      public int getParameterCount() { return params.size(); }
      public Object getParameter(int pIndex) { return params.get(pIndex); }
    };
  }
View Full Code Here

Examples of org.apache.xmlrpc.parser.XmlRpcRequestParser

    }
   
    protected Object unmarshalRequest(Exchange exchange, InputStream stream) throws Exception {
        InputSource isource = new InputSource(stream);
        XMLReader xr = newXMLReader();
        XmlRpcRequestParser xp;
        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
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.