You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by bu...@apache.org on 2002/08/12 01:27:22 UTC
DO NOT REPLY [Bug 11622] New: -
incorrect xsi:type at null properties of returned bean
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11622>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11622
incorrect xsi:type at null properties of returned bean
Summary: incorrect xsi:type at null properties of returned bean
Product: Axis
Version: current (nightly)
Platform: PC
OS/Version: Linux
Status: NEW
Severity: Major
Priority: Other
Component: Serialization/Deserialization
AssignedTo: axis-dev@xml.apache.org
ReportedBy: k@les.cz
Hello,
In my application I need to invoke a method that needs a complex bean
(containg arrays of another beans) as a parameter.
It looks like
public class SOAPTransaction {
private AccountingReportDTO accountingReports[];
private AccountingReportItemDTO accountingReportItems[];
private TournamentAccountingDTO tournamentAccountings[];
private TournamentAccountingMiscItemDTO tournamentAccountingMiscItems[];
private RegionTournamentPersonPairChartDTO regionTournamentPersonPairCharts[];
private RegionTournamentPersonSingleChartDTO regionTournamentPersonSingleCharts[];
private TournamentPairChartDTO tournamentPairCharts[];
private LeagueDTO leagues[];
etc... (of course with approriate accessors and mutators defined).
*DTO classes are simple beans of Strings, ints and java.util.Dates.
In my deploy.wsdd descriptor I define following mappings:
<beanMapping qname="myNS:SOAPTransaction"
xmlns:myNS="urn:SynchronizerService"
languageSpecificType="java:net.templation.cfo.ws.SOAPTransaction"/>
<beanMapping qname="myNS:AccountingReportDTO"
xmlns:myNS="urn:SynchronizerService"
languageSpecificType="java:net.templation.cfo.dto.AccountingReportDTO"/>
<beanMapping qname="myNS:AccountingReportItemDTO"
xmlns:myNS="urn:SynchronizerService"
languageSpecificType="java:net.templation.cfo.dto.AccountingReportItemDTO"/>
etc...
I'm trying to invoke a simple echo method (takes a SOAPTransaction object
as an argument and returns it back).
Unfortunatelly, properties of returned beans seem to have their xsi:type
set incorrectly:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:echoResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="SynchronizerService">
<echoReturn href="#id0"/>
</ns1:echoResponse>
<multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:SO
APTransaction" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns2="urn:SynchronizerService">
<accountingReportItems xsi:type="ns2:SOAPTransaction" xsi:nil="true"/>
<accountingReports xsi:type="ns2:SOAPTransaction" xsi:nil="true"/>
etc...
(e.g. <accountingReportItems should have xsi:type="nsX:AccountingReportItemDTO").
Non-null properties are typed correctly.
The same problem occures at null values of simple beans:
e.g. if I look deeply into the returned XML, I can see PersonDTO
(a bean containing Strings and booleans) is serialized in following
way:
<multiRef id="id3" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns11:P
ersonDTO" xmlns:ns11="urn:SynchronizerService"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<addrCity xsi:type="ns11:PersonDTO" xsi:nil="true"/>
<addrEmail xsi:type="ns11:PersonDTO" xsi:nil="true"/>
<addrStreet xsi:type="ns11:PersonDTO" xsi:nil="true"/>
<addrStreetNo xsi:type="ns11:PersonDTO" xsi:nil="true"/>
<addrZipCode xsi:type="ns11:PersonDTO" xsi:nil="true"/>
<cfoIdNum xsi:type="ns11:PersonDTO" xsi:nil="true"/>
<idCardNum xsi:type="ns11:PersonDTO" xsi:nil="true"/>
<isGlobalAdmin xsi:type="xsd:boolean">false</isGlobalAdmin>
<isRegionAdmin xsi:type="xsd:boolean">false</isRegionAdmin>
<personId xsi:type="xsd:string">three</personId>
You can see null properties have set xsi:type="ns11:PersonDTO"
instead of correct "xsd:string", but non-null values (boolean
flags or personId) have correctly set "xsd:boolean" and "xsd:string).
Sorry for too complex example, it may be just a general error of
serializing null properties, unfortunatelly I'm too tired now to
write a simple test case using a simpler bean :-)
It happens with beta-3 as well as with current snapshot (20020811).
I'm running Axis with JBoss-3.0.1/Jetty on Redhat 7.3 box.