 
 M: server-error error.
     "Error in XML supplied to server" print
-    "Description: " write dup server-error-message print
-    "Tag: " write server-error-tag xml>string print ;
+    "Description: " write dup message>> print
+    "Tag: " write tag>> xml>string print ;
 
 PROCESS: xml>item ( tag -- object )
 


GENERIC: send-rpc ( rpc -- xml )
M: rpc-method send-rpc
    [ rpc-method-name ] keep rpc-method-params method-call ;
M: rpc-response send-rpc
    rpc-response-params return-params ;
M: rpc-fault send-rpc
    [ rpc-fault-code ] keep rpc-fault-string return-fault ;

! * Recieving RPC requests
! this needs to have much better error checking

    first-child-tag params>array ;

: parse-method ( xml -- string array )
    children-tags first2
    [ children>string ] [ params>array ] bi* ;

: parse-fault ( xml -- fault-code fault-string )
    first-child-tag first-child-tag first-child-tag
