Examples of XmlRpcString


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

   * <code>{@link XmlRpcRequestParser#parseRequest(InputStream)}</code> parses
   * correctly a XML-RPC request containing struct parameters.
   */
  public final void testParseRequestWithStructParameters() {
    XmlRpcStruct xmlRpcStruct = new XmlRpcStruct();
    xmlRpcStruct.add("name", new XmlRpcString("Darth Vader"));
    xmlRpcStruct.add("role", new XmlRpcString("Sith lord"));

    XmlRpcElement[] parameters = { xmlRpcStruct };

    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><struct>");

    XmlRpcMember[] members = xmlRpcStruct.getMembers();
    int memberCount = members.length;
    for (int i = 0; i < memberCount; i++) {
      XmlRpcMember member = members[i];
      XmlRpcString value = (XmlRpcString) member.value;

      builder.append("<member><name>");
      builder.append(member.name);
      builder.append("</name><value>");
      builder.append(value.getValue());
      builder.append("</value></member>");
    }

    builder.append("</struct></value></param></params></methodCall>");

View Full Code Here

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

          String source = DomUtils.getTextValue(xmlElement);
          return new XmlRpcInteger(source);

        } else if (XmlRpcElementNames.STRING.equals(childName)) {
          String source = DomUtils.getTextValue(xmlElement);
          return new XmlRpcString(source);

        } else if (XmlRpcElementNames.STRUCT.equals(childName)) {
          return parseStructElement(xmlElement);

        } else {
          XmlRpcParsingUtils.handleUnexpectedElementFound(childName);
        }

      } else if (child instanceof Text) {
        String source = DomUtils.getTextValue(valueElement);
        return new XmlRpcString(source);
      }
    }

    // we should not reach this point.
    return null;
View Full Code Here

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

            return new XmlRpcInteger(source);

          } else if (XmlRpcElementNames.STRING.equals(localName)
              || XmlRpcElementNames.INT.equals(localName)) {
            String source = reader.getElementText();
            return new XmlRpcString(source);

          } else if (XmlRpcElementNames.STRUCT.equals(localName)) {
            return parseStructElement(reader);

          } else {
            XmlRpcParsingUtils.handleUnexpectedElementFound(localName);
          }

        case XMLStreamConstants.CHARACTERS:
          String source = reader.getText();
          return new XmlRpcString(source);
      }
    }

    // we should not reach this point.
    return null;
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.