[Twisted-Python] question : txdbus and dbus-send

Dear All I take https://github.com/cocagne/txdbus/blob/master/doc/tutorial_examples/simple_s... and save it to /home/bino/Documents/mbink/pythons/coretac/dbus00.py bino@bino-pata:~$ ls -la /home/bino/Documents/mbink/pythons/coretac |grep dbus -rwxrwxr-x 1 bino bino 1026 Apr 22 12:08 dbus00.py It's work as expected when 'called' using https://github.com/cocagne/txdbus/blob/master/doc/tutorial_examples/simple_c... Now I need to callable using dbus-send I wrote '/usr/share/dbus-1/services/org.example.service' as : [D-BUS Service] Name=org.example.MyObjPath Exec=/home/bino/Documents/mbink/pythons/coretac/dbus00.py I try to call : dbus-send --system --print-reply \ --type=method_call \ --dest='org.example.MyObjPath' '/org/example/MyObjPath' \ org.example.MyObjPath.exampleMethod string:'MYTEXT' But I got error msg : Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.example.MyObjPath was not provided by any .service files Kindly please give me any enlightenment sincerely -bino-

On Mon, Apr 22, 2013 at 2:25 AM, <bino@indoakses-online.com> wrote:
Dear All I take
https://github.com/cocagne/txdbus/blob/master/doc/tutorial_examples/simple_s... and save it to /home/bino/Documents/mbink/pythons/coretac/dbus00.py
It's work as expected when 'called' using
https://github.com/cocagne/txdbus/blob/master/doc/tutorial_examples/simple_c...
Now I need to callable using dbus-send I wrote '/usr/share/dbus-1/services/org.example.service' as :
[D-BUS Service] Name=org.example.MyObjPath Exec=/home/bino/Documents/mbink/pythons/coretac/dbus00.py
The "Name" in the org.example.services file refers to the bus name(s) exported by the application. The file should instead read: [D-BUS Service] Name=org.example Exec=/home/bino/Documents/mbink/pythons/coretac/dbus00.py
I try to call : dbus-send --system --print-reply \ --type=method_call \ --dest='org.example.MyObjPath' '/org/example/MyObjPath' \ org.example.MyObjPath.exampleMethod string:'MYTEXT'
But I got error msg ... <snip>
There are several problems here. The command should be: dbus-send --session --print-reply --type=method_call --dest='org.example' '/MyObjPath' org.example.MyIFace.exampleMethod string:'MYTEXT' --session means you're using the session bus instead of the system bus (which requires a .service file in a different directory and, possibly, an entry in /etc/dbus-1/..). The --dest flag, similar to the Name of the .service file, refers to the bus name rather than the object. '/MyObjPath' is the full object path exported by the server application. Lastly, the fully-qualified method name is the interface name plus the method name rather than the object name plus method name. It's pretty easy to confuse the various names and paths in DBus. I did so more than once while writing up this reply. Tom

Dear Tom
--session means you're using the session bus instead of the system bus (which requires a .service file in a different directory and, possibly, an entry in /etc/dbus-1/..). The --dest flag, similar to the Name of the .service file, refers to the bus name rather than the object. '/MyObjPath' is the full object path exported by the server application. Lastly, the fully-qualified method name is the interface name plus the method name rather than the object name plus method name. It's pretty easy to confuse the various names and paths in DBus. I did so more than once while writing up this reply.
I really appreciate your enlightenment. I'll do your suggestion. Sincerely -bino-
participants (2)
-
bino@indoakses-online.com
-
Tom Cocagne