Title: Escaping special characters inside the SOAP body

Hello all.  I've got a quick question.

I'm using Tomcat 4.0.1 with SOAP 2.2 servlet.  My deployed service is a Java class method, and returns an XML fragment as a String.

public String foo() {
        return "<reply>foo</reply>";
}

So I would expect the SOAP reply to look something like this:

<SOAP-ENV:Envelope
xmlns:SOAP-ENV="Some-URI"
SOAP-ENV:encodingStyle="Some-URI"/>
<SOAP-ENV:Body>
<m:foo xmlns:m="Some-URI">
<reply>foo</reply>
</m:foo>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

However, the reply I'm getting is this

<SOAP-ENV:Envelope
xmlns:SOAP-ENV="Some-URI"
SOAP-ENV:encodingStyle="Some-URI"/>
<SOAP-ENV:Body>
<m:foo xmlns:m="Some-URI">
&lt;reply&gt;foo&lt;/reply&gt;
</m:foo>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

So now the problem is my client cannot parse the XML reply.  I'm using a Perl LWP client, but I've snooped the connection and the server is the one escaping the special characters inside the Body tag.  I do not want to make the client translate the escaped characters back, because I may want to use Java clients, VB clients, etc., so I'd rather solve this problem once, instead of for every type of client.

How can I prevent the special characters inside the Body tag to not be escaped?

Thanks in advance!

~tsd

****************************
Todd S. Davenport
96 CG/SCTOA
Eglin AFB, FL
COM: (850) 882-5498
DSN: 872-5498
[EMAIL PROTECTED]
****************************

Reply via email to