Re: JAXRPC - "string" as return params - escape chars problem

From: <>
Date: Thu, 2 Dec 2004 13:03:18 -0800

Thanks for the response Russel,

I tried with the CDATA earlier on before sending the message, but the
JAXRPC runtime SOAP handlers still treat it as a string
and escape whatever is in the CDATA section: <![CDATA[ ....... ]]>

I wanted to see if i could tweek the JAXRPC runtime classes (since the
java code is supplied) to ignore the escaping of the characters,
since the JAXRPC runtime classes do the encoding.



Message from Russell Butek <> received on 12/02/2004 10:49

12/02/2004 10:49 AM

Russell Butek <>

        To: Mohit Saigal/USTRA/ABB_at_ABB
        Subject: Re: JAXRPC - "string" as return params - escape chars problem

Try wrapping your string inside a CDATA block:

myString = "CDATA[[" + myString + "]]";

A SOAP engine will wrap data inside a CDATA block if it wants to ignore
what's in that block. Since engines do it, I don't see why you can't.
I've never tried this, though, and I'm not exactly sure about the format
the CDATA block (ie., does it really have two [[ and ]]? I think so). You
may want to do a google search for CDATA to find out for sure.

Russell Butek
Web services consultant
IBM Software Services for WebSphere
512 940 8592 wrote on 12/01/2004 10:20:48 PM:

> Hi Folks,
> Got your emails from the "" website. Some very helpful
> articles on the web site. I am faced with a problem regarding
> "string" return parameters from a web serice. Explanation is below,
> would appreciate all the help. I tried searching the mailing lists,
> but to no avail.
> By default, if i have a string (which contains xml data) being
> returned as part of a JAXRPC webservice return parameter, the escape
> characters are showing up (which i presume is the default behaviour).
> At this time, i want to avoid a doc-literal style, xml-fragment
> style and soap attachments. This is because the rpc-encoded string
> works best for our clients.
> Is there a way to make the soap handlers AVOID escaping the xml
> string data within the soap message? Using JWSDP 1.5
> All the help is much appreciated ... example is below:
> For example: ....
> <?xml version="1.0" encoding="UTF-8"?>
> <env:Envelope xmlns:env=""
> xmlns:xsd="" xmlns:xsi="http://www.
>" xmlns:enc="http://schemas.xmlsoap.
> org/soap/encoding/" xmlns:ns0="" env:encodingStyle="
> <env:Body><ans1:getResListResponse xmlns:ans1="">
> <result xsi:type="xsd:string">
> &lt;resourcelist&gt; &lt;resource name="RES1"
> type="GEN" participant="MP1" user="USER1"
> delivery_date="2004-11-01" /&gt; &lt;/resourcelist&gt;
> </result>
> </ans1:getResListResponse>
> </env:Body>
> </env:Envelope>
> Regards,
> Mohit Saigal

Attention: Attachment "C.htm" has been removed from this note on December
02 2004 by Mohit Saigal/USTRA/ABB