Examples of XmlRpcArray


Examples of org.springmodules.remoting.xmlrpc.support.XmlRpcArray

   */
  public final void testWriteResponseWithArrayParameters() {
    XmlRpcString firstValue = new XmlRpcString("Darth Vader");
    XmlRpcString secondValue = new XmlRpcString("Darth Sidius");

    XmlRpcArray xmlRpcArray = new XmlRpcArray();
    xmlRpcArray.add(firstValue);
    xmlRpcArray.add(secondValue);

    XmlRpcElement[] parameters = { xmlRpcArray };
    XmlRpcResponse response = new XmlRpcResponse(parameters);

    StringBuffer builder = new StringBuffer(256);
View Full Code Here

Examples of org.springmodules.remoting.xmlrpc.support.XmlRpcArray

   * Verifies that the method
   * <code>{@link XmlRpcRequestParser#parseRequest(InputStream)}</code> parses
   * correctly a XML-RPC request containing array parameters.
   */
  public final void testParseRequestWithArrayParameters() {
    XmlRpcArray xmlRpcArray = new XmlRpcArray();
    xmlRpcArray.add(new XmlRpcString("Luke"));
    xmlRpcArray.add(new XmlRpcString("Leia"));

    XmlRpcElement[] parameters = { xmlRpcArray };

    XmlRpcRequest expected = new XmlRpcRequest(this.serviceName,
        this.methodName, parameters);

    StringBuffer builder = new StringBuffer();
    builder.append("<?xml version=\"1.0\"?>");
    builder.append("<methodCall><methodName>");
    builder.append(this.serviceAndMethodNames);
    builder.append("</methodName><params><param><value><array><data>");

    XmlRpcElement[] elements = xmlRpcArray.getElements();
    int memberCount = elements.length;
    for (int i = 0; i < memberCount; i++) {
      XmlRpcString element = (XmlRpcString) elements[i];

      builder.append("<value>");
View Full Code Here

Examples of org.springmodules.remoting.xmlrpc.support.XmlRpcArray

   *          the XML element to parse.
   * @return the created XML-RPC array.
   * @see #parseValueElement(Element)
   */
  protected final XmlRpcArray parseDataElement(Element dataElement) {
    XmlRpcArray array = new XmlRpcArray();

    NodeList children = dataElement.getChildNodes();
    int childCount = children.getLength();

    for (int i = 0; i < childCount; i++) {
      Node child = children.item(i);

      if (child instanceof Element) {
        String childName = child.getNodeName();

        if (XmlRpcElementNames.VALUE.equals(childName)) {
          Element valueElement = (Element) child;
          XmlRpcElement element = parseValueElement(valueElement);
          array.add(element);
        }
      }
    }
    return array;
  }
View Full Code Here

Examples of org.springmodules.remoting.xmlrpc.support.XmlRpcArray

   * @return the new array of <code>java.util.List</code>s.
   * @see #parseValueElement(XMLStreamReader)
   */
  protected final XmlRpcArray parseDataElement(XMLStreamReader reader)
      throws XMLStreamException {
    XmlRpcArray array = new XmlRpcArray();

    while (reader.hasNext()) {
      int event = reader.next();
      String localName = null;

      switch (event) {
        case XMLStreamConstants.START_ELEMENT:
          localName = reader.getLocalName();

          if (XmlRpcElementNames.VALUE.equals(localName)) {
            XmlRpcElement element = parseValueElement(reader);
            array.add(element);
          }
          break;

        case XMLStreamConstants.END_ELEMENT:
          localName = reader.getLocalName();
View Full Code Here

Examples of redstone.xmlrpc.XmlRpcArray

   * @throws XmlRpcFault
   *           Generic exception for xml-rpc operations
   */
  @SuppressWarnings("unchecked")
  public List<Author> getAuthors() throws XmlRpcFault {
    XmlRpcArray r = this.wp.getAuthors(0, this.username, this.password);
    return fillFromXmlRpcArray(r, Author.class);
  }
View Full Code Here

Examples of redstone.xmlrpc.XmlRpcArray

   * @throws XmlRpcFault
   *           Generic exception for xml-rpc operations
   */
  @SuppressWarnings("unchecked")
  public List<Category> getCategories() throws XmlRpcFault {
    XmlRpcArray r = this.wp.getCategories(0, this.username, this.password);
    return fillFromXmlRpcArray(r, Category.class);
  }
View Full Code Here

Examples of redstone.xmlrpc.XmlRpcArray

   * @throws XmlRpcFault
   *           Generic exception for xml-rpc operations
   */
  @SuppressWarnings({ "unchecked", "boxing" })
  public List<PageDefinition> getPageList() throws XmlRpcFault {
    XmlRpcArray r = this.wp.getPageList(0, this.username, this.password);
    return fillFromXmlRpcArray(r, PageDefinition.class);
  }
View Full Code Here

Examples of redstone.xmlrpc.XmlRpcArray

   * @throws XmlRpcFault
   *           Generic exception for xml-rpc operations
   */
  @SuppressWarnings({ "unchecked", "boxing" })
  public List<Page> getPages() throws XmlRpcFault {
    XmlRpcArray r = this.wp.getPages(0, this.username, this.password);
    return fillFromXmlRpcArray(r, Page.class);
  }
View Full Code Here

Examples of redstone.xmlrpc.XmlRpcArray

   * @throws XmlRpcFault
   *           Generic exception for xml-rpc operations
   */
  @SuppressWarnings({ "unchecked", "boxing" })
  public List<Ping> getTrackbackPings(int postId) throws XmlRpcFault {
    XmlRpcArray r = this.mt.getTrackbackPings(postId);
    return fillFromXmlRpcArray(r, Ping.class);
  }
View Full Code Here

Examples of redstone.xmlrpc.XmlRpcArray

   *           Generic exception for xml-rpc operations
   */
  public List<URL> getPingbacks(String url) throws XmlRpcFault {
    List<URL> result = null;
    try {
      XmlRpcArray r = this.pingbackExt.getPingbacks(url);
      result = new ArrayList<URL>();
      for (Object rec : r) {
        result.add(new URL((String) rec));
      }
    } catch (MalformedURLException 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.