You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Anand Natrajan <an...@cs.virginia.edu> on 2004/07/07 16:39:41 UTC
Bug in wsdl/stub gen for String[] return?
Hello,
One of the operations in my web service has a Java signature like this:
public String[] getParameters(String dsName) throws RemoteException;
Using Axis 1.2beta (June 14th build), I run java2wsdl to get an rpc/enc WSDL
(call it re.wsdl) and again to get a doc/lit WSDL (call it dl.wsdl). Next, I
run wsdl2java on each of these WSDLs to generate separate sets of stub
clients.
What I notice is that the signature of the above method in the stubs is
different. In the stub generated from re.wsdl, the signature looks like:
public java.lang.String[]
getParameters(java.lang.String dsName) throws java.rmi.RemoteException;
but in the stub generate from dl.wsdl, the signature looks like:
public java.lang.String
getParameters(java.lang.String dsName) throws java.rmi.RemoteException;
The stub signature from dl.wsdl seems wrong to me, so I looked at the WSDL
fragments themselves. Here's a fragment from re.wsdl:
<wsdl:message name="getParametersRequest">
<wsdl:part name="dsName" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="getParametersResponse">
<wsdl:part name="getParametersReturn" type="impl:ArrayOf_xsd_string"/>
</wsdl:message>
and here's the corresponding fragment from dl.wsdl:
<element name="getParametersReturn" type="xsd:string"/>
...
<wsdl:message name="getParametersRequest">
<wsdl:part element="impl:dsName" name="dsName"/>
</wsdl:message>
<wsdl:message name="getParametersResponse">
<wsdl:part element="impl:getParametersReturn" name="getParametersReturn"/>
</wsdl:message>
Notice that the WSDL fragment for dl.wsdl sets a type of xsd:string for the
return type. Needless to say, clients I am targetting to these generated
stubs fail to compile for the doc/lit case.
Is this a bug, or am I doing something wrong? If it is, has it been fixed in
the last 3 weeks? Shall I enter a bug report? If it isn't a bug, can someone
enlighten me as to what I am doing wrong?
As a small bit information, I have other operations that return arrays of
custom types - those seem to work okay. Here's an example:
re.wsdl:
public com.abc.api.common.Permission[]
permissions(java.lang.String path) throws java.rmi.RemoteException;
dl.wsdl:
public com.abc.ws.stubs.ArrayOf_tns1_DataCatalogPermission
permissions(java.lang.String path) throws java.rmi.RemoteException;
Although not identical, they're close enough that I can work with them.
Anand Natrajan