parthy (parthy) wrote in lj_dev,
parthy
parthy
lj_dev

Problems with groupmask attribute in getfriends xml-rpc

Hi guys,

According to this http://www.livejournal.com/doc/server/ljp.csp.xml-rpc.getfriends.html ,getfriends returns friends array with each friend having an attribute called groupmask.

I am using this xml-rpc.net package with c# . I get this error while parsing through the getfriends response:

CookComputing.XmlRpc.XmlRpcTypeMismatchException: response contains struct value with missing non-optional members: groupmask type [response : struct mapped to type ResultForGetFriends : member friends mapped to type Friend[] : array mapped to type Friend[] : element 0 : struct mapped to type Friend]

But I do have this member called groupmask. One thing that needs to be noted is that when I call getfriends, the getfriends response do not contain groupmask member (although based on the protocol it is require member returned by LJ).

The following code shows the return type for getfriends:

    public class Friend
    {
        public string username;
        public string fullname;
        public string type;
        public string fgcolor;
        public string bgcolor;
        public uint groupmask;
    };

    public class FriendGroup
    {
        public int id;
        public string name;
        public int sortorder;
        [XmlRpcMember("public")]
        public bool Public;
    };

    public class ResultForGetFriends
    {
        public FriendGroup[] friendGroups;
        public Friend[] friendOfs;
        public Friend[] friends;

    };

uint stands for unsigned int (32 bit) in c#. This is how I call getfriends (it shows the return type):

LJ.ResultForGetFriends res = proxy.getFriends(args);

Does anyone know why I would be getting this exception? Does anyone know if groupmask refers to  uint in c#? I tried with an array of bytes with size 4. No luck. I tried string. No luck.

  • groupmask(required):

    • [scalar](required) If the group mask is not "1" (just bit 0 set), then this variable is returned with an 32-bit unsigned integer with a bit 0 always set, and bits 1-30 set for each group this friend is a part of. Bit 31 is reserved.

Thank you kindly,
parthy
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 3 comments