axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Iltchenko, Andrei" <Andrei.Iltche...@nl.compuware.com>
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
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
following wsdl document is fed to WSDL2Java:

<?xml version="1.0" ?>

<definitions name="urn:AddressFetcher"
             targetNamespace="urn:AddressFetcher2"
             xmlns:tns="urn:AddressFetcher2"
             xmlns:typens="urn:AddressFetcher2"
             xmlns:xsd="http://www.w3.org/1999/XMLSchema"
             xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
             xmlns="http://schemas.xmlsoap.org/wsdl/">

<types>
<schema attributeFormDefault="qualified" elementFormDefault="qualified"
  targetNamespace="urn:AddressFetcher2"
   xmlns="http://www.w3.org/1999/XMLSchema">

  <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>

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

</schema>
</types>

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

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

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

<service name="DoExample">
  <port name="Example" binding="tns:ExampleSoap">
    <soap:address
location="http://localhost:8080/axis/services/AddressBook"/>
  </port>
</service>

</definitions>

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,
Andrei.


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


Mime
View raw message