Empty TAG in response.

  • Cleverton Hentz

    Cleverton Hentz - 2004-08-26

    I'm using Dxmlrpc in a new project.
    When I receive response for XML-RPC call some params be empty. When this occur the struct in IRpcResult It do not contain a null parameter.

    I'm show a exemple of this:

    if i try access like this exemple, "Obj.KeyExists('CONTA_AGENTE')", return false.

    Any help will be welcome.
    Cleverton Hentz

    • Marand

      Marand - 2004-09-03

      Similar problem here. Having a struct member in a result can cause its name to be mistakenly returned as the name of one of its items. Actual example:
      <?xml version="1.0" encoding="iso-8859-1"?>
                  <member><name>sitename</name><value><string>Riff news</string></value></member>
                              <member><name>date_polled</name><value><string>2004-09-03 11:07:35</string></value></member>
      res.KeyList [0] = 'feedid
      res.KeyList [1] = 'sitename'
      ... this is correct, but:
      res.KeyList [2] = 'redirection'
      ... this is NOT correct, AIUI XML-RPC.

    • Marand

      Marand - 2004-09-03

      In version 2.0, a fix exists, but is not activated by default. Just use:

      var cal    : TRpcCaller ;

      cal := TRpcCaller.Create ;
      cal.FixEmptyStrings := True ;

      FixEmptyStrings defaults to False:
      XmlRpcClient / TRpcCaller.Create:
      inherited Create ; --> TRpcClientParser.Create
      additional code doesn't change this field

        inherited Create; --> TObject.Create
      and strictly nothing more

      So the property defaults to the TObject default: 0 value, meaning False by default.

    • Cleverton Hentz

      Cleverton Hentz - 2004-09-06

      For your case yes, but for my no.
      In my case tag is empty, i.e. <String/> .I'm implemente one new case in function FixEmptyString() for situation with emtpy tags. This code was add to end of function.

      //By Hentz- 26/08/2004 - Exclude TAG from struct when XML TAG "<string/>" appears.
        Result := StringReplace(Result,'<string/>',
            '<string>[NULL]</string>', [rfReplaceAll, rfIgnoreCase]);

    • mahadewi

      mahadewi - 2006-09-19

      how i can send many parameters as record data type ?


Log in to post a comment.