Hi Tom, While SOAP does contain an xml declaration, it's not a problem that the String contains one. The less than (<) and greater than (>) characters are replaced with entity references, so the first line becomes:
<? xml version="1.0 ?> which means nothing to a parser so it ignores it. Regards, Richard -----Original Message----- From: tom ONeill [mailto:[EMAIL PROTECTED] Sent: 07 January 2004 17:38 To: [EMAIL PROTECTED] Subject: Re: XML within string parameter to RPC Service Hi Martin, Thanks for your response. I do not have a choice on the type of web service to use i.e. RPC or messaging. The web service is provided by an external partner and they have decided upon RPC so that is what I have to go with. So because Axis changes all markup characters into their entity references I do not have to worry about wrapping the XML string in a CDATA section. Another question I know have is if there is any side effect of the XML string passed as a parameter to the RPC having a prolog which includes the XML declaration. What I have in effect is a SOAP document with the XML prolog and declaration and then another XML declaration within the character data content of an element within a SOAP document. Will this cause problems? Is it correct that the content of a SOAP element includes an XML declaration. Thanks, Tom From: Richard Martin <[EMAIL PROTECTED]> Subject: XML within string parameter to RPC Service Date: Tue, 6 Jan 2004 18:08:50 -0000 Content-Type: text/plain; charset="us-ascii" Hi tom, Comments inline: >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? You don't need to wrap it. Technically if you are passing XML then RPC isn't the best way to go - a message based service would be better if you can stand using org.w3c.dom classes. >>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 >) AXIS has to remove all of the restricted characters in XML ( <, >, and & ) and put entity references or it will break the XML parsers in both the client and server. To my knowledge however, these references are automagically replaced by axis before invoking the web service - so if you are invoking a web service with a String argument containing XML, it shouldn't contain any entity references. Regards, Richard _________________________________________________________________ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail
