Result type aa{sv} (array of maps string - variant) doesn't work

Bug #621064 reported by smaug
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
NDesk D-Bus
New
Undecided
Unassigned

Bug Description

Hello,
I've been developing some code to communicate with Amarok 2, which provides some informations (about collection, interface org.kde.amarok.Collection) as an array of maps. Unforunately, ndesk-dbus throws an exception:

Unhandled Exception: System.Exception: Read non-zero byte at position 4 while expecting padding
  at NDesk.DBus.MessageReader.ReadPad (Int32 alignment) [0x00000]
  at NDesk.DBus.MessageReader.ReadArray (System.Type elemType) [0x00000]
  at NDesk.DBus.MessageReader.ReadValue (System.Type type) [0x00000]
  at NDesk.DBus.MessageHelper.GetDynamicValues (NDesk.DBus.Message msg, System.Type[] types) [0x00000]
  at NDesk.DBus.BusObject.SendMethodCall (System.String iface, System.String member, System.String inSigStr, NDesk.DBus.MessageWriter writer, System.Type retType, System.Exception& exception) [0x00000]
  at Amarok.ICollectionProxy.MprisQuery (System.String ) [0x00000]
  at Amarok.Amarok.Main () [0x00020] in /home/smaug/progs/gnome-do-amarok/gnome-do-amarok/Amarok.cs:27

I've tested version from git, but it also (before I was using 0.6.0 from Debian) doesn't work. Below is the code, which generates exception. The signature of MprisQuery method has been copied from dbus-explorer.

#v+

using System;
using System.Runtime.InteropServices;
using NDesk.DBus;
using System.Collections.Generic;

namespace Amarok
{

 [NDesk.DBus.Interface("org.kde.amarok.Collection")]
 interface ICollection
 {
  [return: Argument("result")]
  Dictionary<string, object>[] MprisQuery(string queryXml);
 };

 public class Amarok
 {
  public static int Main()
  {
   String q="<query version=\"1.0\"><limit value=\"5\" /><filters><or><include field=\"title\" value=\"Tonight, Tonight, Tonight\"/></or></filters><includeCollection id=\"localCollection\" /></query>";
   ICollection c = Bus.Session.GetObject<ICollection>("org.mpris.amarok",new ObjectPath("/Collection"));
   System.Console.WriteLine("{0}", c.MprisQuery(q).ToString());
   return 0;
  }

 }
}
#v-

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.