Index: test/harness/utils.py
===================================================================
--- test/harness/utils.py	(revision 3808)
+++ test/harness/utils.py	(working copy)
@@ -3,6 +3,11 @@
 file in order for the tests that use it to work.  The test
 harness does that automatically for you."""
 
+import dbus
+bus = dbus.SessionBus()
+dbusOrca = bus.get_object('org.gnome.Orca', '/')
+dbusOrcaLogging = dbus.Interface(dbusOrca, 'org.gnome.Orca.Logging')
+
 # Where to find Dojo tests.
 #
 #DojoURLPrefix="http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/tests/"
@@ -47,10 +52,7 @@
             AtomicAction.__init__(self, 0, lambda: None)
 
     def _startRecording(self):
-        import sys, urllib
-        f = urllib.urlopen("http://localhost:20433", "recordStart")
-        result = f.read()
-        f.close()
+        dbusOrcaLogging.startRecording()
 
     def __str__(self):
         return 'Start Recording Action'
@@ -115,17 +117,7 @@
             AtomicAction.__init__(self, 0, lambda: None)
 
     def _stopRecording(self):
-        import sys, urllib
-
-        f = urllib.urlopen("http://localhost:20433", "recordStop")
-        result = ''
-        while True:
-            someRead = f.read()
-            result += someRead
-            if not len(someRead):
-                break
-        f.close()
-
+        result = dbusOrcaLogging.stopRecording()
         results = self._assertionPredicate(result, self._expectedResults)
         if not results:
             AssertPresentationAction.totalSucceed += 1
Index: test/harness/harness.sh
===================================================================
--- test/harness/harness.sh	(revision 3808)
+++ test/harness/harness.sh	(working copy)
@@ -261,11 +261,11 @@
 
             echo === $testFile
             newResultsFile=`basename $testFile .py`
-            wget --output-file /dev/null --post-data="debug:0:./tmp/$application/$newResultsFile" localhost:20433
-            wget --output-file /dev/null --post-data="log:./tmp/$application/$newResultsFile" localhost:20433
+            dbus-send --reply-timeout=100 --print-reply --dest=org.gnome.Orca / org.gnome.Orca.Logging.setDebug string:"./tmp/$application/$newResultsFile" int:0
+            dbus-send --reply-timeout=100 --print-reply --dest=org.gnome.Orca / org.gnome.Orca.Logging.setLogFile string:"./tmp/$application/$newResultsFile"
             python $testFile
-            wget --output-file /dev/null --post-data="log:" localhost:20433
-            wget --output-file /dev/null --post-data="debug:10000" localhost:20433
+            dbus-send --reply-timeout=100 --print-reply --dest=org.gnome.Orca / org.gnome.Orca.Logging.setLogFile string:""
+            dbus-send --reply-timeout=100 --print-reply --dest=org.gnome.Orca / org.gnome.Orca.Logging.setDebug string:"" int:10000
 
             # Copy the results (.orca) file to the output directory.
             # This is the file that will be used for regression
Index: src/orca/settings.py
===================================================================
--- src/orca/settings.py	(revision 3808)
+++ src/orca/settings.py	(working copy)
@@ -258,7 +258,7 @@
 # The port to listen on if orca is to act as an HTTP server
 # (mainly as a speech server for self-voicing applications).
 #
-httpServerPort          = 20433
+httpServerPort          = 0
 
 # The number of attempts to retry setting up an HTTP server
 # connection (each time incrementing the port number by 1).
Index: src/orca/httpserver.py
===================================================================
--- src/orca/httpserver.py	(revision 3808)
+++ src/orca/httpserver.py	(working copy)
@@ -49,11 +49,7 @@
     as a speech service.
 
     The protocol is simple: POST content is 'stop', 'speak:<text>',
-    or 'isSpeaking'.  A POST content of 'log:filename' will also
-    instruct Orca to log speech and braille output to
-    'filename.speech' and 'filename.braille'.  A POST content of
-    'debug:level:filename' will instruct Orca to send debug output
-    at 'level' (an integer value) to 'filename.debug'.
+    or 'isSpeaking'.
 
     To test this, run:
 
@@ -92,74 +88,6 @@
                 self.send_header("Content-type", "text/html")
                 self.end_headers()
                 self.wfile.write("%s" % speech.isSpeaking())
-            elif settings.enableRemoteLogging and inputBody.startswith("log:"):
-                import logging
-                logFile = inputBody[4:]
-                for logger in ['braille', 'speech']:
-                    log = logging.getLogger(logger)
-                    formatter = logging.Formatter('%(message)s')
-                    try:
-                        loggingFileHandlers[logger].flush()
-                        loggingFileHandlers[logger].close()
-                        log.removeHandler(loggingFileHandlers[logger])
-                    except:
-                        pass
-                    if logFile and len(logFile):
-                        loggingFileHandlers[logger] = logging.FileHandler(
-                            '%s.%s' % (logFile, logger), 'w')
-                        loggingFileHandlers[logger].setFormatter(formatter)
-                        log.addHandler(loggingFileHandlers[logger])
-                    log.setLevel(logging.INFO)
-                self.send_response(200, 'OK')
-            elif settings.enableRemoteLogging and inputBody == "recordStart":
-                import logging
-                import StringIO
-                for logger in ['braille', 'speech']:
-                    log = logging.getLogger(logger)
-                    try:
-                        [stringIO, handler] = loggingStreamHandlers[logger]
-                        handler.close()
-                        log.removeHandler(handler)
-                        stringIO.close()
-                    except:
-                        pass
-                    formatter = logging.Formatter('%(message)s')
-                    stringIO = StringIO.StringIO()
-                    handler = logging.StreamHandler(stringIO)
-                    handler.setFormatter(formatter)
-                    log.addHandler(handler)
-                    loggingStreamHandlers[logger] = [stringIO, handler]
-                    log.setLevel(logging.INFO)
-                self.send_response(200, 'OK')
-            elif settings.enableRemoteLogging and inputBody == "recordStop":
-                import logging
-                import StringIO
-                result = ''
-                for logger in ['braille', 'speech']:
-                    log = logging.getLogger(logger)
-                    try:
-                        [stringIO, handler] = loggingStreamHandlers[logger]
-                        handler.flush()
-                        handler.close()
-                        log.removeHandler(handler)
-                        result += stringIO.getvalue()
-                        stringIO.close()
-                    except:
-                        debug.printException(debug.LEVEL_OFF)
-                    stringIO = StringIO.StringIO()
-                self.send_response(200, 'OK')
-                self.send_header("Content-type", "text/html")
-                self.end_headers()
-                self.wfile.write(result)
-            elif inputBody.startswith("debug:"):
-                split = inputBody.split(':')
-                debug.debugLevel = int(split[1])
-                if debug.debugFile:
-                    debug.debugFile.close()
-                    debug.debugFile = None
-                if (len(split) == 3) and (len(split[2])):
-                    debug.debugFile = open('%s.debug' % split[2], 'w', 0)
-                self.send_response(200, 'OK')
         else:
             debug.println(debug.LEVEL_FINEST,
                           "httpserver._HTTPRequestHandler received no data")
Index: src/orca/dbusserver.py
===================================================================
--- src/orca/dbusserver.py	(revision 0)
+++ src/orca/dbusserver.py	(revision 0)
@@ -0,0 +1,153 @@
+# Orca
+#
+# Copyright 2008 Sun Microsystems Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+"""Exposes Orca as a DBus service for testing and watchdog purposes."""
+
+__id__        = "$Id: httpserver.py 3445 2008-01-11 17:05:52Z wwalker $"
+__version__   = "$Revision: 3445 $"
+__date__      = "$Date: 2008-01-11 12:05:52 -0500 (Fri, 11 Jan 2008) $"
+__copyright__ = "Copyright (c) 2008 Sun Microsystems Inc."
+__license__   = "LGPL"
+
+import dbus
+import dbus.service
+import dbus.mainloop.glib
+
+import debug
+import platform
+import settings
+
+# Handlers for logging speech and braille output.
+#
+loggingFileHandlers = {}
+loggingStreamHandlers = {}
+
+class Server(dbus.service.Object):
+
+    @dbus.service.method(dbus_interface='org.gnome.Orca.Logging',
+                         in_signature='si', out_signature='')
+    def setDebug(self, debugFile, debugLevel):
+        """Sets the file to send detailed debug information."""
+        if not settings.enableRemoteLogging:
+            return
+        debug.println(debug.LEVEL_FINEST,
+                      "DBus Logging.setDebug(%s, %d)" \
+                      % (debugFile, debugLevel))
+        if debug.debugFile:
+            debug.debugFile.close()
+            debug.debugFile = None
+        if debugFile and len(debugFile):
+            debug.debugFile = open('%s.debug' % debugFile, 'w', 0)
+        debug.debugLevel = debugLevel
+
+    @dbus.service.method(dbus_interface='org.gnome.Orca.Logging',
+                         in_signature='s', out_signature='')
+    def setLogFile(self, logFile):
+        """Sets the file to send speech and braille logging information."""
+        if not settings.enableRemoteLogging:
+            return
+        import logging
+        debug.println(debug.LEVEL_FINEST,
+                      "DBus Logging.setLogFile(%s)" % logFile)
+        for logger in ['braille', 'speech']:
+            log = logging.getLogger(logger)
+            formatter = logging.Formatter('%(message)s')
+            try:
+                loggingFileHandlers[logger].flush()
+                loggingFileHandlers[logger].close()
+                log.removeHandler(loggingFileHandlers[logger])
+            except:
+                pass
+            if logFile and len(logFile):
+                loggingFileHandlers[logger] = logging.FileHandler(
+                    '%s.%s' % (logFile, logger), 'w')
+                loggingFileHandlers[logger].setFormatter(formatter)
+                log.addHandler(loggingFileHandlers[logger])
+            log.setLevel(logging.INFO)
+
+    @dbus.service.method(dbus_interface='org.gnome.Orca.Logging',
+                         in_signature='', out_signature='')
+    def startRecording(self):
+        """Tells Orca to start logging speech and braille output."""
+        if not settings.enableRemoteLogging:
+            return
+        debug.println(debug.LEVEL_FINEST, "DBus Logging.startRecording")
+        import logging
+        import StringIO
+        for logger in ['braille', 'speech']:
+            log = logging.getLogger(logger)
+            try:
+                [stringIO, handler] = loggingStreamHandlers[logger]
+                handler.close()
+                log.removeHandler(handler)
+                stringIO.close()
+            except:
+                pass
+            formatter = logging.Formatter('%(message)s')
+            stringIO = StringIO.StringIO()
+            handler = logging.StreamHandler(stringIO)
+            handler.setFormatter(formatter)
+            log.addHandler(handler)
+            loggingStreamHandlers[logger] = [stringIO, handler]
+            log.setLevel(logging.INFO)
+
+    @dbus.service.method(dbus_interface='org.gnome.Orca.Logging',
+                         in_signature='', out_signature='s')
+    def stopRecording(self):
+        """Tells Orca to stop logging speech and braille output and
+        to return whatever was recorded since the last call to
+        startRecording."""
+        if not settings.enableRemoteLogging:
+            return ""
+        debug.println(debug.LEVEL_FINEST, "DBus Logging.stopRecording")
+        import logging
+        import StringIO
+        result = ''
+        for logger in ['braille', 'speech']:
+            log = logging.getLogger(logger)
+            try:
+                [stringIO, handler] = loggingStreamHandlers[logger]
+                handler.flush()
+                handler.close()
+                log.removeHandler(handler)
+                result += stringIO.getvalue()
+                stringIO.close()
+            except:
+                debug.printException(debug.LEVEL_OFF)
+            stringIO = StringIO.StringIO()
+        return result
+
+obj = None
+
+def init():
+    """Sets up the Orca DBus service.  This will only take effect once
+    the Orca main loop starts."""
+
+    global obj
+
+    if obj:
+        return
+
+    dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+    bus = dbus.SessionBus()
+    name = dbus.service.BusName('org.gnome.Orca', bus=bus)
+    obj = Server(name, '/')
+
+def shutdown():
+    pass
Index: src/orca/orca.py
===================================================================
--- src/orca/orca.py	(revision 3808)
+++ src/orca/orca.py	(working copy)
@@ -55,6 +55,7 @@
 import pyatspi
 import braille
 import debug
+import dbusserver
 import httpserver
 import keynames
 import keybindings
@@ -829,6 +830,7 @@
 
     # Shutdown the output drivers and give them a chance to die.
     #
+    dbusserver.shutdown()
     httpserver.shutdown()
     speech.shutdown()
     braille.shutdown()
@@ -940,6 +942,7 @@
 
     showMainWindowGUI()
 
+    dbusserver.init()
     httpserver.init()
 
     return True
Index: src/orca/orca.in
===================================================================
--- src/orca/orca.in	(revision 3808)
+++ src/orca/orca.in	(working copy)
@@ -50,17 +50,17 @@
 
 # The watchdog will periodically ping Orca to see if it is responding.
 # If orca isn't responding, the watchdog will kill the Orca process.
-# The watchdog logic requires 'wget', so we won't do it if we can't
-# find wget in the path.  Note also that you can force WATCHDOG=0 if you
+# The watchdog logic requires 'dbus-send', so we won't do it if we can't
+# find dbus-send in the path.  Note also that you can force WATCHDOG=0 if you
 # do not want a background process that periodically pings Orca to see
 # if it is responding.
 #
 IFS=:
-WGETCMD=
+DBUSSENDCMD=
 WATCHDOG=0
 for dir in $PATH:/usr/sfw/bin:/usr/local/bin; do
-    test -x "$dir/wget" && {
-        WGETCMD="$dir/wget"
+    test -x "$dir/dbus-send" && {
+        DBUSSENDCMD="$dir/dbus-send"
         WATCHDOG=1
         break
     }
@@ -134,7 +134,7 @@
 
 # Runs a watchdog process in the background.  It merely attempts to
 # get to Orca via some other means than the AT-SPI.  Here we use
-# Orca's http server at port 20433.  If it doesn't respond, then
+# a Ping on the Orca DBus service.  If it doesn't respond, then
 # we assume Orca is dead.
 #
 watchdog()
@@ -151,10 +151,12 @@
             then
                 exit
             else
-                $WGETCMD -q -t 0 -O /dev/null -w 2 "http://localhost:20433" || {
+                $DBUSSENDCMD --reply-timeout=100 --print-reply --dest=org.gnome.Orca / org.freedesktop.DBus.Peer.Ping > /dev/null 2>&1 
+                if [ "$?" -ne 0 ] 
+                then
                     echo Orca watchdog detected something bad.  Cleaning up.
                     cleanup
-                }
+                fi
             fi
         done
     ) &
Index: src/orca/Makefile.am
===================================================================
--- src/orca/Makefile.am	(revision 3808)
+++ src/orca/Makefile.am	(working copy)
@@ -16,6 +16,7 @@
 	braillegenerator.py \
 	brlmon.py \
 	chnames.py \
+	dbusserver.py \
 	debug.py \
 	dectalk.py \
 	default.py \
