From: Alan R. <ala...@gm...> - 2006-03-11 05:47:29
|
I'm using and XmlRpc server and it needs to throw XmlRpcException when appropriate. Is there some way to do this within lisp? (defun setup-server () (setq *xml-rpc-server* (new 'WebServer *xml-rpc-server-port*)) (#"start" *xml-rpc-server*) (let ((proxy (jinterface-implementation (find-java-class "org.apache.xmlrpc.XmlRpcHandler") "execute" (lambda (method args) (handle-rpc-call method args)) ))) (#"addHandler" *xml-rpc-server* "$default" proxy))) (defun handle-rpc-call (method args) (multiple-value-bind (value condition) (ignore-errors (cond ((equal (#"toString" method) "echo") (+ 1 nil) (#"toString" (#"elementAt" args 0))) (t (format nil "Error - Don't know method ~a" (#"toString" method))))) (if condition (format nil "Error: ~a" condition) value))) ;;; <----- need to throw XmlRpcException here. Thanks, Alan |