You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rpc-user@xml.apache.org by Marcel Ruff <ru...@swand.lake.de> on 2001/08/23 12:57:34 UTC
CDATA and XmlRpc?
Hi,
if i send this to helma XmlRpc server it works fine:
------------------
<qos>
<securityService type="gui" version="1.0">
<user>ClientSub</user>
<passwd>secret</passwd>
</securityService>
</qos>
------------------
If i add a CDATA section:
------------------
<qos>
<securityService type="gui" version="1.0">
<![CDATA[
<user>ClientSub</user>
<passwd>secret</passwd>
]]>
</securityService>
</qos>
------------------
i get following exception:
POST / HTTP/1.1
Content-Length: 592
Content-Type: text/xml
User-Agent: Java1.3.1-beta
Host: develop.ruff.de:8080
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
startElement: methodCall
startElement: methodName
endElement: methodName
startElement: params
startElement: param
startElement: value
Fatal error parsing XML: org.xml.sax.SAXParseException:
org.apache.crimson.parser/P-072
org.xml.sax.SAXParseException: org.apache.crimson.parser/P-072
at
org.apache.crimson.parser.InputEntity.fatal(InputEntity.java:1038)
at
org.apache.crimson.parser.InputEntity.parsedContent(InputEntity.java:561)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1742)
at
org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1461)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1695)
at
org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1461)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1695)
at
org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1461)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1695)
at
org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1461)
at
org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:499)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:304)
at
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
at
org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223)
at helma.xmlrpc.XmlRpc.parse(XmlRpc.java:209)
at helma.xmlrpc.XmlRpcServer$Worker.execute(XmlRpcServer.java:104)
at helma.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:67)
at helma.xmlrpc.WebServer$Connection.run(WebServer.java:330)
at helma.xmlrpc.WebServer$Runner.run(WebServer.java:248)
at java.lang.Thread.run(Thread.java:484)
any idea?
thanks for a hint,
Marcel
--
Marcel Ruff
mailto:ruff@swand.lake.de
http://www.lake.de/home/lake/swand/
http://www.xmlBlaster.org
Re: CDATA and XmlRpc?
Posted by John Wilson <tu...@wilson.co.uk>.
This XML is passed as a <string> value to a call, right?
I *think* I know what is happening. The helma code will escape the <
characters but not the > ones. So the ]]> sequence will appear unchanged in
the body of the <string> element. This is not well formed XML according to
the XML spec. hence the exception.
In MinML-RPC I escape <, & and > for this reason (in MinML I don't throw an
error if I find a ]]> sequence outside an CDATA section, so I get one thing
right and one thing wrong ;)))
John Wilson
The Wilson Partnership
http://www.wilson.co.uk
----- Original Message -----
From: "Marcel Ruff" <ru...@swand.lake.de>
To: <rp...@xml.apache.org>
Sent: Thursday, August 23, 2001 11:57 AM
Subject: CDATA and XmlRpc?
> Hi,
>
> if i send this to helma XmlRpc server it works fine:
> ------------------
> <qos>
> <securityService type="gui" version="1.0">
> <user>ClientSub</user>
> <passwd>secret</passwd>
> </securityService>
> </qos>
> ------------------
>
> If i add a CDATA section:
>
> ------------------
> <qos>
> <securityService type="gui" version="1.0">
> <![CDATA[
> <user>ClientSub</user>
> <passwd>secret</passwd>
> ]]>
> </securityService>
> </qos>
> ------------------
>
> i get following exception:
>
>
> POST / HTTP/1.1
> Content-Length: 592
> Content-Type: text/xml
> User-Agent: Java1.3.1-beta
> Host: develop.ruff.de:8080
> Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
> Connection: keep-alive
>
> startElement: methodCall
> startElement: methodName
> endElement: methodName
> startElement: params
> startElement: param
> startElement: value
> Fatal error parsing XML: org.xml.sax.SAXParseException:
> org.apache.crimson.parser/P-072
> org.xml.sax.SAXParseException: org.apache.crimson.parser/P-072
> at
> org.apache.crimson.parser.InputEntity.fatal(InputEntity.java:1038)
> at
> org.apache.crimson.parser.InputEntity.parsedContent(InputEntity.java:561)
> at org.apache.crimson.parser.Parser2.content(Parser2.java:1742)
> at
> org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1461)
> at org.apache.crimson.parser.Parser2.content(Parser2.java:1695)
> at
> org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1461)
> at org.apache.crimson.parser.Parser2.content(Parser2.java:1695)
> at
> org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1461)
> at org.apache.crimson.parser.Parser2.content(Parser2.java:1695)
> at
> org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1461)
> at
> org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:499)
> at org.apache.crimson.parser.Parser2.parse(Parser2.java:304)
> at
> org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
> at
> org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223)
> at helma.xmlrpc.XmlRpc.parse(XmlRpc.java:209)
> at
helma.xmlrpc.XmlRpcServer$Worker.execute(XmlRpcServer.java:104)
> at helma.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:67)
> at helma.xmlrpc.WebServer$Connection.run(WebServer.java:330)
> at helma.xmlrpc.WebServer$Runner.run(WebServer.java:248)
> at java.lang.Thread.run(Thread.java:484)
>
>
> any idea?
>
> thanks for a hint,
>
>
> Marcel
>
> --
> Marcel Ruff
> mailto:ruff@swand.lake.de
> http://www.lake.de/home/lake/swand/
> http://www.xmlBlaster.org
>
Re: CDATA and XmlRpc?
Posted by John Wilson <tu...@wilson.co.uk>.
This XML is passed as a <string> value to a call, right?
I *think* I know what is happening. The helma code will escape the <
characters but not the > ones. So the ]]> sequence will appear unchanged in
the body of the <string> element. This is not well formed XML according to
the XML spec. hence the exception.
In MinML-RPC I escape <, & and > for this reason (in MinML I don't throw an
error if I find a ]]> sequence outside an CDATA section, so I get one thing
right and one thing wrong ;)))
John Wilson
The Wilson Partnership
http://www.wilson.co.uk
----- Original Message -----
From: "Marcel Ruff" <ru...@swand.lake.de>
To: <rp...@xml.apache.org>
Sent: Thursday, August 23, 2001 11:57 AM
Subject: CDATA and XmlRpc?
> Hi,
>
> if i send this to helma XmlRpc server it works fine:
> ------------------
> <qos>
> <securityService type="gui" version="1.0">
> <user>ClientSub</user>
> <passwd>secret</passwd>
> </securityService>
> </qos>
> ------------------
>
> If i add a CDATA section:
>
> ------------------
> <qos>
> <securityService type="gui" version="1.0">
> <![CDATA[
> <user>ClientSub</user>
> <passwd>secret</passwd>
> ]]>
> </securityService>
> </qos>
> ------------------
>
> i get following exception:
>
>
> POST / HTTP/1.1
> Content-Length: 592
> Content-Type: text/xml
> User-Agent: Java1.3.1-beta
> Host: develop.ruff.de:8080
> Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
> Connection: keep-alive
>
> startElement: methodCall
> startElement: methodName
> endElement: methodName
> startElement: params
> startElement: param
> startElement: value
> Fatal error parsing XML: org.xml.sax.SAXParseException:
> org.apache.crimson.parser/P-072
> org.xml.sax.SAXParseException: org.apache.crimson.parser/P-072
> at
> org.apache.crimson.parser.InputEntity.fatal(InputEntity.java:1038)
> at
> org.apache.crimson.parser.InputEntity.parsedContent(InputEntity.java:561)
> at org.apache.crimson.parser.Parser2.content(Parser2.java:1742)
> at
> org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1461)
> at org.apache.crimson.parser.Parser2.content(Parser2.java:1695)
> at
> org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1461)
> at org.apache.crimson.parser.Parser2.content(Parser2.java:1695)
> at
> org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1461)
> at org.apache.crimson.parser.Parser2.content(Parser2.java:1695)
> at
> org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1461)
> at
> org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:499)
> at org.apache.crimson.parser.Parser2.parse(Parser2.java:304)
> at
> org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
> at
> org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223)
> at helma.xmlrpc.XmlRpc.parse(XmlRpc.java:209)
> at
helma.xmlrpc.XmlRpcServer$Worker.execute(XmlRpcServer.java:104)
> at helma.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:67)
> at helma.xmlrpc.WebServer$Connection.run(WebServer.java:330)
> at helma.xmlrpc.WebServer$Runner.run(WebServer.java:248)
> at java.lang.Thread.run(Thread.java:484)
>
>
> any idea?
>
> thanks for a hint,
>
>
> Marcel
>
> --
> Marcel Ruff
> mailto:ruff@swand.lake.de
> http://www.lake.de/home/lake/swand/
> http://www.xmlBlaster.org
>