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 2004/01/16 11:13:47 UTC

DO NOT REPLY [Bug 26189] New: - Incorrect mapping of local elements with minOccurs="0" maxOccurs="1"

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=26189>.
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=26189

Incorrect mapping of local elements with minOccurs="0" maxOccurs="1"

           Summary: Incorrect mapping of local elements with minOccurs="0"
                    maxOccurs="1"
           Product: Axis
           Version: 1.1
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Major
          Priority: Other
         Component: WSDL processing
        AssignedTo: axis-dev@ws.apache.org
        ReportedBy: Andrei.Iltchenko@nl.compuware.com


The current version of JAX-RPC says:

There are a number of cases in which a built-in simple XML data type must be
mapped to the corresponding Java wrapper class for the Java primitiv type:
* an element declaration with the nillable attribute set to true
* an element declaration with the minOccurs attribute set to 0 (zero)
  and the maxOccurs attribute set to 1 (one)or absent;
* an attribute declaration with the use attribute set to optional or
  absent and carrying neither the default nor the fixed attribute;

However, this doesn't seem to be the approach that Axis takes. When the global 
element "DoExample" is referenced, WSDL2Java maps the local element "value2" to 
the primitive type long, instead of mapping it to java.lang.Long, as it should 
be.

  <element name="out" type="xsd:long"/>
  <element name="DoExample">
    <complexType>
      <sequence>
        <element name="value1" nillable="true" maxOccurs="unbounded"
type="xsd:base64Binary"/>
        <element name="value2" minOccurs="0" maxOccurs="1"
ref="typens:out"/>
      </sequence>
    </complexType>
  </element>

When the attached wsdl document is fed to WSDL2Java, the following service 
endpoint interface is generated:

public interface ExampleSoap extends java.rmi.Remote {
    public void doExample(byte[][] value1,
                          long out,
                          javax.xml.rpc.holders.ByteArrayHolder ret,
                          javax.xml.rpc.holders.LongHolder out2)
    throws java.rmi.RemoteException;
}

whereas the proper mapping is:

public interface ExampleSoap extends java.rmi.Remote {
    public void doExample(byte[][] value1,
                          java.lang.Long out,
                          javax.xml.rpc.holders.ByteArrayHolder ret,
                          javax.xml.rpc.holders.LongWrapperHolder out2)
    throws java.rmi.RemoteException;
}