Menu

return with a empty string

Help
Anonymous
2003-05-19
2003-05-20
  • Anonymous

    Anonymous - 2003-05-19

    hi,

    i want to return a vector(array) from server,  but if the vector contins a empty string, xmlrpc-client will not get a correct result. is this a bug? or i mis-used?. See following example:

    string str = ...; // value get from other place, and maybe empty
    XmlRpcValue result;

    result[0][0] = "error"
    result[1][1] = str;

     
    • Chris Morley

      Chris Morley - 2003-05-20

      I suspect you are making a mistake, but you have not provided enough information for a complete diagnosis.

      In your code, you are returning a 2 dimensional array, with values specified only at the diagonal elements (you are not setting result[0][1] or result[1][0] to any value). I doubt that is what you intended.

      If you want to return a simple array, something like this will work better:

      result[0] = "error";
      result[1] = str;

       
    • Anonymous

      Anonymous - 2003-05-20

      sorry, i made a mistake assuredly. but now it doesn't matter, i use version 0.5 formely, now i've updated to the lastest version, and all is ok.

      thanks for your help. btw, your works pretty good :)

       

Log in to post a comment.