Uploaded image for project: 'XML-RPC'
  1. XML-RPC
  2. XMLRPC-195

StringSerializer does not create <string> tag

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Not A Problem
    • Affects Version/s: 3.1.3
    • Fix Version/s: None
    • Component/s: Source
    • Labels:
      None
    • Environment:
      Windows 7

      Description

      Consider a method call (API) named 'login' that takes in 4 parameters major version (integer), minor version (integer), user name (string) and password (string). Below code snippet explains how I invoke this remote API.

      XmlRpcClient client = new XmlRpcClient();
      Object[] loginParams =

      {new Integer(2), new Integer(0), new String("user@sample.com"), new String("password")}

      ;
      client.execute("login", loginParams);

      The four parameters are wrapped as Object array to method call named 'login'. Below is the XML generated and passed to server hosting login API:

      <methodCall>
      <methodName>login</methodName>
      <params>
      <param>
      <value>
      <i4>2</i4>
      </value>
      </param>
      <param>
      <value>
      <i4>0</i4>
      </value>
      </param>
      <param>
      <value>
      user@sample.com
      </value>
      </param>
      <param>
      <value>
      password
      </value>
      </param>
      </params>
      </methodCall>

      As you notice the user name - user@sample.com and password - password are serialized without '<string>' tag. Is this intentional. I referred the code StringSerializer and noticed that '<string>' tag is not passed to write method. By XML-RPC specification http://xmlrpc.scripting.com/spec it should have been:
      :
      <value>
      <string>
      user@sample.com
      </string>
      </value>
      :

      Any specific reason for this change in behavior ?

        Attachments

          Activity

            People

            • Assignee:
              jochen.wiedmann@gmail.com Jochen Wiedmann
              Reporter:
              rgokul Gokulakrishnan
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: