axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Iltchenko, Andrei" <>
Subject Bug in WSDL2Java?
Date Fri, 09 Jan 2004 13:16:01 GMT
The current version of JAX-RPC says:

There are a number of cases in which a built-in simple XML data type must be
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
following wsdl document is fed to WSDL2Java:

<?xml version="1.0" ?>

<definitions name="urn:AddressFetcher"

<schema attributeFormDefault="qualified" elementFormDefault="qualified"

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

  <element name="DoExampleResponse">
        <element name="ret" nillable="true" type="xsd:base64Binary"/>
        <element name="out" minOccurs="0" maxOccurs="1" ref="typens:out"/>


<message name="DoExample">
  <part name="body" element="typens:DoExample"/>
<message name="DoExampleResponse">
  <part name="result" element="typens:DoExampleResponse"/>

<portType name="ExampleSoap">
  <operation name="DoExample" parameterOrder="body result">
    <input message="tns:DoExample"/>
    <output message="tns:DoExampleResponse"/>

<binding name="ExampleSoap" type="tns:ExampleSoap">
  <soap:binding style="document"
  <operation name="DoExample">
    <soap:operation soapAction="" style="document"/>
    <input message="tns:DoExample">
      <soap:body use="literal" parts="body" />
    <output message="tns:DoExampleResponse">
      <soap:body use="literal" parts="result" />

<service name="DoExample">
  <port name="Example" binding="tns:ExampleSoap">


The toolkit generates the following WS Endpoint Interface:

package AddressFetcher2;

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;

As you can see, instead of having mapped the "<element name="value2"
minOccurs="0" maxOccurs="1"  ref="typens:out"/>" construct to
java.lang.Long, it mapped it to Java's int.

So long as there's a general agreement that this is a bug, I could try to
write a patch for it.

Thanks in advance,

The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it. 

View raw message