Hi Tom,

My understanding (which may be wrong) is that the automagic escaping of < into &lt; 
means that you don't have to worry about this at all. Axis has done all the hard work.

It's a bit like the way you can just stop worrying about quote marks in JDBC when you 
switch from Statements to PreparedStatements.

Hope this helps
Keith


-----Original Message-----
From: tom ONeill [mailto:[EMAIL PROTECTED]
Sent: 06 January 2004 14:06
To: [EMAIL PROTECTED]
Subject: XML within string parameter to RPC Service 


Hi all,
I am going to be using Axis to invoke an RPC style web service which takes a 
single string parameter. This string parameter is going to contain an XML 
message. What I am wondering is if I need to wrap this String in a CDATA 
section before I invoke the web service?

>From reading the XML specification it says that character data consists of 
any text that does not contain markup. However my string value will contain 
markup. I have tested invoking the web service without wrapping my String in 
a CDATA section and have found that Axis has changed all the markup 
characters into their respective entity references (i.e. < has become < ). 
What Im wondering is why Axis is doing this? Im not sure how it creates its 
SOAP messages but from a brief glance of the code I guess it uses DOM 
(rather than plain String manipulation ). From looking at the DOM API it 
does not mention anything about the createTextNode method parsing the text 
content and expanding markup to use entity references?

Any recommendations or pointers as to what should influence whether the text 
should be wrapped in a CDATA section would help....

Cheers,
Tom

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE* 
http://join.msn.com/?page=features/junkmail

Reply via email to