|
From: Matthew K. <kr...@wa...> - 2001-04-19 18:15:06
|
I'm looking into using XML-RPC for a project at work. I have installed an XML-RPC server under a test server here that seems to work OK - it passes the 'validating' tests at validator.xmlrpc.com but I seem to be having some problems using the xml-rpc client built on top of tclDom (using the tclXml parser). The problem seems to be related to the DOCTYPE tag as I show below (I've added some 'puts' to the tcl code so I could see exactly what was being generated): --- % xmlrpc::call $url $proc -struct $args Executing rpc: {<?xml version='1.0'?> <!DOCTYPE methodCall> <methodCall><methodName>validator1.easyStructTest</methodName><params><param><value><struct><member><name>curly</name><value><i4>4</i4></value></member><member><name>larry</name><value><i4>5</i4></value></member><member><name>moe</name><value><i4>6</i4></value></member></struct></value></param></params></methodCall>} callresponse: HTTP status ok data {Ooh, a nasty error: invalid node ID } XMLRPC_ERROR {remote procedure call failed due to "invalid token """} --- OK, that doesn't really tell us too much. After a lot of digging arround I figured it was somehow related to the DOCTYPE tag and modified TclDOM to not automatically generate/print the DOCTYPE tag. This is what I got: --- % xmlrpc::call $url $proc -struct $args Executing rpc: {<?xml version='1.0'?> <methodCall><methodName>validator1.easyStructTest</methodName><params><param><value><struct><member><name>curly</name><value><i4>4</i4></value></member><member><name>larry</name><value><i4>5</i4></value></member><member><name>moe</name><value><i4>6</i4></value></member></struct></value></param></params></methodCall>} callresponse: HTTP status ok data {<?xml version="1.0"?> <methodResponse> <params> <param> <value> <i4>15</i4> </value> </param> </params> </methodResponse> } 15 --- So things worked well. My questions, then are: 1. Is DOCTYPE _required_ for wellformedness 2. It seems that most xml-rpc implementations do not include the DOCTYPE tag. There is no mention made of it in the xmlrpc.org spec page, and it is not present in any examples. Given that, is there some way we could make optional the automatic insertion of the DOCTYPE that tclDom performs? I realize that it would probaly be better to have an rpc server that could handle either case, but there are some large barriers there (we are using AOLServer with the ns_xml extention and an rpc client on top of that - it works, but I'm not sure how much I want to mess with it.) matthew |