<?xml version="1.0" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugzilla.globus.org/bugzilla/bugzilla.dtd">

<bugzilla version="3.2.3"
          urlbase="http://bugzilla.globus.org/bugzilla/"
          maintainer="bacon@mcs.anl.gov"
>

    <bug>
          <bug_id>5622</bug_id>
          
          <creation_ts>2007-10-18 07:39</creation_ts>
          <short_desc>WSDL2Java does not serialize xsi:type on fault types</short_desc>
          <delta_ts>2007-10-18 08:20:37</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Java WS Core</product>
          <component>Roadmap</component>
          <version>4.0.4</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          
          
          
          
          
          <priority>P3</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Fabio Simeoni">fabio.simeoni@cis.strath.ac.uk</reporter>
          <assigned_to name="Rachana Ananthakrishnan">ranantha@mcs.anl.gov</assigned_to>
          <cc>jwscore-dev@globus.org</cc>

      

      
          <long_desc isprivate="0">
            <who name="Fabio Simeoni">fabio.simeoni@cis.strath.ac.uk</who>
            <bug_when>2007-10-18 07:39:13</bug_when>
            <thetext>Apologies in advance if this bug has already surfaced before or it has been solved in later versions. 

Custom fault classes generated by WSDL2Java do not serialise xsi:type information. This seems related to the method writeDetail() which is generated with an implementation of:

public void writeDetails(QName qname, SerializationContext context) throws IOException {    	
context.serialize(qname, null, this);
} 

which explcitly does not serialise any attribute (second parameter is null).

The end result is lack of &apos;subtyping&apos; on faults and thus the necessity that all clients catch explicitly all the subclasses of an exception hierarchy. A manual modification to the generated stubs is required to restore subtyping on faults.

(As far as I can tell Axis src code -- at least in vanilla version 1.4 -- shows the intention to parse the fault with the class specified in &lt;exceptionName&gt;, but it actually doesn&apos;t. so xsi:type remains the only solution.)

I could not think of any other temporary solution to this problem (xsi:type information can only be generated from WSDL information and this seems to survive only in auto-generated fault classes). Any suggestion appreciated.

cheers,

f</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who name="Fabio Simeoni">fabio.simeoni@cis.strath.ac.uk</who>
            <bug_when>2007-10-18 08:20:37</bug_when>
            <thetext>
A rectification: the lack of subtyping for faults implies that _the service_ has to explicitly declare all the classes it may throw out of a potentially large fault hierarchy.

cheers,

f</thetext>
          </long_desc>
      
      

    </bug>

</bugzilla>