Examples of XmlRpcBoolean


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

   * <code>{@link XmlRpcResponseWriter#writeResponse(XmlRpcResponse)}</code>
   * creates the XML-RPC response correctly if the response contains boolean
   * parameters.
   */
  public final void testWriteResponseWithBooleanParameters() {
    XmlRpcBoolean[] parameters = { new XmlRpcBoolean(Boolean.TRUE),
        new XmlRpcBoolean(Boolean.FALSE) };

    XmlRpcResponse response = new XmlRpcResponse(parameters);

    StringBuffer builder = new StringBuffer();
    builder.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
    builder.append("<methodResponse><params>");

    int parameterCount = parameters.length;
    for (int i = 0; i < parameterCount; i++) {
      XmlRpcBoolean xmlRpcBoolean = parameters[i];
      Boolean value = (Boolean) xmlRpcBoolean.getValue();

      builder.append("<param><value><boolean>");
      builder.append(value.booleanValue() ? "1" : "0");
      builder.append("</boolean></value></param>");
    }
View Full Code Here

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

   * Verifies that the method
   * <code>{@link XmlRpcRequestParser#parseRequest(InputStream)}</code> parses
   * correctly a XML-RPC request containing boolean parameters.
   */
  public final void testParseRequestWithBooleanParameters() {
    XmlRpcBoolean[] parameters = { new XmlRpcBoolean(Boolean.TRUE),
        new XmlRpcBoolean(Boolean.FALSE) };

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

    int parameterCount = parameters.length;
    for (int i = 0; i < parameterCount; i++) {
      XmlRpcBoolean xmlRpcBoolean = parameters[i];
      Boolean value = (Boolean) xmlRpcBoolean.getValue();

      builder.append("<param><value><boolean>");
      builder.append(value.booleanValue() ? "1" : "0");
      builder.append("</boolean></value></param>");
    }
View Full Code Here

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

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

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

        } else if (XmlRpcElementNames.DATE_TIME.equals(childName)) {
          String source = DomUtils.getTextValue(xmlElement);
          return new XmlRpcDateTime(source);
View Full Code Here

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

            String source = reader.getElementText();
            return new XmlRpcBase64(source);

          } else if (XmlRpcElementNames.BOOLEAN.equals(localName)) {
            String source = reader.getElementText();
            return new XmlRpcBoolean(source);

          } else if (XmlRpcElementNames.DATE_TIME.equals(localName)) {
            String source = reader.getElementText();
            return new XmlRpcDateTime(source);
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.