axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Keese <bi...@tech.beacon-it.co.jp>
Subject Re: Array serialization
Date Mon, 07 Mar 2005 00:30:14 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Yeah, that is normal behavior, but they are going to change the
behavior in a future release so that it's always bare arrays (ie, no
&lt;item&gt; tag).&nbsp; See<br>
<div class="action-details"> <a name="action_59497"> Comment by </a><a
 href="http://issues.apache.org/jira/secure/ViewProfile.jspa?name=jongjinchoi">Jongjin
Choi</a> <font size="-2">[<span class="date">21/Feb/05 12:10 PM</span>]</font>
</div>
in <a class="moz-txt-link-freetext" href="http://issues.apache.org/jira/browse/AXIS-1547">http://issues.apache.org/jira/browse/AXIS-1547</a><br>
<br>
Guillaume Sauthier wrote:
<blockquote cite="mid422831DB.9010301@objectweb.org" type="cite">Hi all
  <br>
  <br>
I've found something weird in Array serialization :
  <br>
  <br>
We have a Bean that hold an array of something (here its an array of
Book), it provides methods to access its content (may be a getter or
indexed getter)
  <br>
  <br>
And I see that the serilaized message looks different if we use indexed
getter or direct getter !!
  <br>
  <br>
Here are the traces :
  <br>
  <br>
#1:
  <br>
without indexed methods :
  <br>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  <br>
&lt;soapenv:Envelope
xmlns:soapenv=<a class="moz-txt-link-rfc2396E" href="http://schemas.xmlsoap.org/soap/envelope/">"http://schemas.xmlsoap.org/soap/envelope/"</a>
  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
xmlns:xsd=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>
  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
xmlns:xsi=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema-instance">"http://www.w3.org/2001/XMLSchema-instance"</a>&gt;
  <br>
&nbsp;&lt;soapenv:Body&gt;
  <br>
&nbsp; &lt;echoInOutBookArray xmlns=""&gt;
  <br>
&nbsp;&nbsp; &lt;varBook xsi:type="ns1:ArrayOfBook"
xmlns:ns1=<a class="moz-txt-link-rfc2396E" href="http://holdertest.org/xsd">"http://holdertest.org/xsd"</a>&gt;
  <br>
&nbsp;&nbsp;&nbsp; &lt;arrayOfBook&gt;
  <br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;item xsi:type="ns1:Book"&gt;
  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;author xsi:type="xsd:string"&gt;author0&lt;/author&gt;
  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;isbn xsi:type="xsd:int"&gt;0&lt;/isbn&gt;
  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;title xsi:type="xsd:string"&gt;title0&lt;/title&gt;
  <br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;/item&gt;
  <br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;item xsi:type="ns1:Book"&gt;
  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;author xsi:type="xsd:string"&gt;author1&lt;/author&gt;
  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;isbn xsi:type="xsd:int"&gt;1&lt;/isbn&gt;
  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;title xsi:type="xsd:string"&gt;title1&lt;/title&gt;
  <br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;/item&gt;
  <br>
&nbsp;&nbsp;&nbsp; &lt;/arrayOfBook&gt;
  <br>
&nbsp;&nbsp; &lt;/varBook&gt;
  <br>
&nbsp; &lt;/echoInOutBookArray&gt;
  <br>
&nbsp;&lt;/soapenv:Body&gt;
  <br>
&lt;/soapenv:Envelope&gt;
  <br>
  <br>
#2:
  <br>
with indexed methods :
  <br>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  <br>
&lt;soapenv:Envelope
xmlns:soapenv=<a class="moz-txt-link-rfc2396E" href="http://schemas.xmlsoap.org/soap/envelope/">"http://schemas.xmlsoap.org/soap/envelope/"</a>
xmlns:xsd=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>
xmlns:xsi=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema-instance">"http://www.w3.org/2001/XMLSchema-instance"</a>&gt;
  <br>
&lt;soapenv:Body&gt;
  <br>
&nbsp;&lt;echoInOutBookArray xmlns=""&gt;
  <br>
&nbsp; &lt;varBook xsi:type="ns1:ArrayOfBook"
xmlns:ns1=<a class="moz-txt-link-rfc2396E" href="http://holdertest.org/xsd">"http://holdertest.org/xsd"</a>&gt;
  <br>
&nbsp;&nbsp; &lt;arrayOfBook xsi:type="ns1:Book"&gt;
  <br>
&nbsp;&nbsp;&nbsp; &lt;author xsi:type="xsd:string"&gt;author0&lt;/author&gt;
  <br>
&nbsp;&nbsp;&nbsp; &lt;isbn xsi:type="xsd:int"&gt;0&lt;/isbn&gt;
  <br>
&nbsp;&nbsp;&nbsp; &lt;title xsi:type="xsd:string"&gt;title0&lt;/title&gt;
  <br>
&nbsp;&nbsp; &lt;/arrayOfBook&gt;
  <br>
&nbsp;&nbsp; &lt;arrayOfBook xsi:type="ns1:Book"&gt;
  <br>
&nbsp;&nbsp;&nbsp; &lt;author xsi:type="xsd:string"&gt;author1&lt;/author&gt;
  <br>
&nbsp;&nbsp;&nbsp; &lt;isbn xsi:type="xsd:int"&gt;1&lt;/isbn&gt;
  <br>
&nbsp;&nbsp;&nbsp; &lt;title xsi:type="xsd:string"&gt;title1&lt;/title&gt;
  <br>
&nbsp;&nbsp; &lt;/arrayOfBook&gt;
  <br>
&nbsp; &lt;/varBook&gt;
  <br>
&nbsp;&lt;/echoInOutBookArray&gt;
  <br>
&lt;/soapenv:Body&gt;
  <br>
&lt;/soapenv:Envelope&gt;
  <br>
  <br>
Is this a normal behavior ? I was expecting Axis to always write a
SOAPMessage as #2 !
  <br>
More, we are in document/literal and #1 looks like a soap encoded array
(using &lt;item&gt;).
  <br>
  <br>
If someone can give me an explanation, I'll be very happy :)
  <br>
  <br>
PS : Just try to uncomment the index getter/setter in
test.holders.ArrayOfBook, you'll see the differences.
  <br>
Note : the test is not failing when we uncomment these methods, that's
just the message format ...
  <br>
  <br>
Regards
  <br>
Guillaume
  <br>
  <br>
  <br>
</blockquote>
</body>
</html>

Mime
View raw message