[jdom-interest] HELP: I want <CUSTOMER>. I get: &lt;CUSTOMER &gt;

Steve Taplin steve.taplin at chp.co.uk
Wed Nov 21 01:09:29 PST 2001


Dear All,

	I don't believe I'm doing anything out of the ordinary and have
attached source and output in hope that someone can spot what I'm doing
wrong.

The source is a trivial proof of concept so if there is an error, it should
be clear to those in the 'know'.

1) Browser_Output       - Test JSP output as rendered by a browser
2) JSP_Output           - Source of JSP output demonstrating character
escapes
3) SettlementQuote.java - Whole source for proof-of-concept DB web service
4) SOAP_in              - HTTP Post to web service
5) SOAP_Out             - HTTP response to client demonstrating problem

SOAP_Out contains the soap envelope XML in a well formed, non-escaped way.
However within the <RETURN> tag, the XML output from the XMLOutputter is
'escaped' throughout.

Kind Regards,

Steve Taplin.

-----Original Message-----
From: Jason Hunter [mailto:jhunter at acm.org] 
Sent: 20 November 2001 04:59
To: Steve Taplin; JDOM Interest
Subject: Re: [jdom-interest] HELP: I want <CUSTOMER>. I get: &lt;CUSTOMER
&gt;

> Unfortunately,  all DOM output (i.e. Xerces and JDom) is now 
> producing, e.g.:
>
> &lt; CUSTOMER &gt;
>
> instead of
>
> <CUSTOMER>

Looks like you're passing <CUSTOMER> as text content to another
element.  Make sure all elements are represented as Element objects, not
as text content within other elements.

-jh-

-------------- next part --------------
HTTP/1.1 200 OK
Server: WebSphere Application Server/4.0
Content-Type: text/xml; charset=utf-8
Set-Cookie: JSESSIONID=0000PF2VYVG20VV0BUMQN0AT4TY:-1;Path=/
Cache-Control: no-cache="set-cookie,set-cookie2"
Expires: Thu, 01 Dec 1994 16:00:00 GMT
Content-Length: 695
Content-Language: en
Connection: close

<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<ns1:getCustomerAgreementsResponse xmlns:ns1="urn:SettlementQuote" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<return xsi:type="xsd:string">&lt;CUSTOMER Name=&quot;j&quot;&gt;
 &lt;Agreement&gt;ANTQT001  &lt;/Agreement&gt;
 &lt;Agreement&gt;C001011532&lt;/Agreement&gt;
 &lt;Agreement&gt;MATTHOWELL&lt;/Agreement&gt;
&lt;/CUSTOMER&gt;

</return>
</ns1:getCustomerAgreementsResponse>

</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
-------------- next part --------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Result</TITLE>
</HEAD>
<BODY>
<H1>Result</H1>









        &lt;CUSTOMER Name=&quot;j&quot;&gt;
 &lt;Agreement&gt;ANTQT001  &lt;/Agreement&gt;
 &lt;Agreement&gt;C001011532&lt;/Agreement&gt;
 &lt;Agreement&gt;MATTHOWELL&lt;/Agreement&gt;
&lt;/CUSTOMER&gt;


        
</BODY>
</HTML>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SettlementQuote.java
Type: application/octet-stream
Size: 3945 bytes
Desc: not available
Url : http://jdom.org/pipermail/jdom-interest/attachments/20011121/9d3c8741/SettlementQuote.obj
-------------- next part --------------
POST /ALFAServices/servlet/rpcrouter HTTP/1.0
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: 494
SOAPAction: "urn:SettlementQuote"

<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<ns1:getCustomerAgreements xmlns:ns1="urn:SettlementQuote" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<customerNumber xsi:type="xsd:string">JEN</customerNumber>
</ns1:getCustomerAgreements>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
-------------- next part --------------
Result
<CUSTOMER Name="j"> <Agreement>ANTQT001 </Agreement> <Agreement>C001011532</Agreement> <Agreement>MATTHOWELL</Agreement> </CUSTOMER> 


More information about the jdom-interest mailing list