I think what yopu're referring to is the nested CDATA problem, if your content contains a CDATA, you can't just write a DOM into a string and wrap the whole thing w/ a CDATA. The way around this is to either entity encode the XML or break into multiple CDATAs. IIRC, Axis will correctly handle encoding strings without any intervention, if it doesn't, it's a bug.
If you're doing document/literal, both string and byte[] are bad approaches anyway. You take a hit on the encoding step, both in the conversion (memory and processor) and on the wire, because base 64 is bigger, and you take a hit to zip it if you try to alleviate the extra network traffic, and after all that, you have to parse the XML again once it's decoded. On top of that, your wdsdl doesn't reflect what the interface expects - now the information that a particular parameter is XML is out of band. The right approach long term is to leave it as XML, you could do String or byte[] as a temporary workaround, but it's a bad general solution. -----Original Message----- From: James Black [mailto:jblack@;ieee.org] Sent: Tuesday, October 29, 2002 8:28 AM To: [EMAIL PROTECTED] Subject: Re: XML and web services Mike Hearn wrote: > I assume you're referring to character encoding issues here? I don't > understand what problems the soap wrapper could cause...... From what I understand, when using a CDATA element, for example, there can be things that will cause some problems with the XML parser that is trying to figure out the message from the headers. Using a byte array ensures that your xml file will not mess up the parsing. > > > James Black wrote: > >> Barry Lulas wrote: >> >> >> > I realize this is an Axis user group, but I wanted to pick your >> > brains >> > on a related issue. >> > >> > I have a generic web service that I deploy via Axis. The web >> > service >> > takes in an XML file as a request and returns an XML file as a >> > response. My question is what is the best way to pass XML data >> > to/from a web service? Should I simply use strings? >> > >> > Any advise would be appreciated... >> > >> Pass the xml file as a byte array, else you will have problems >> with >> the xml wrapper that soap uses. The byte array is base64 encoded, so >> it >> is a safe way to send it around. >> Also, you may want to zip the byte array before sending the xml >> file, >> to help cut down on size. >> >> >> >> The information in this electronic mail message is sender's business Confidential and may be legally privileged. It is intended solely for the addressee(s). Access to this Internet electronic mail message by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it is prohibited and may be unlawful. The sender believes that this E-mail and any attachments were free of any virus, worm, Trojan horse, and/or malicious code when sent. This message and its attachments could have been infected during transmission. By reading the message and opening any attachments, the recipient accepts full responsibility for taking protective and remedial action about viruses and other defects. Galileo International is not liable for any loss or damage arising in any way from this message or its attachments.