axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anne Thomas Manes <>
Subject Re: Ouput primitive array
Date Thu, 09 Feb 2006 12:39:57 GMT
Perhaps I'm fighting windmills here, but ...

You really should start thinking of SOAP in terms of message in and message
out, not in terms of Java IN, OUT, and INOUT parameters. If you want to
return an array of ints, then you should compose that array as part of your
return value.


On 2/9/06, Lisurc <> wrote:
> Hello,
> Writing to the list to maybe get some clues/help on an issue.
> I am currently trying to develop a set of web services using Axis / Tomcat
> 4 as part of a larger web application (another servlet). Everything went
> quite fine until I faced a problem when I wanted one of the parameters of a
> method to be a primitive int array as an ouput parameter.
> I can't manage to explain my config (wsdd) file or java source files I
> want such an out parameter.
> For example, let's say I have a public method WS_MakeSomething in a java
> class named Service defined like the following :
> public class Service {
> public int WS_MakeSomething(int a, int[] array)  {
> ...
> }
> }
> I'd like this method to return an int value and consider the array
> parameter as an output parameter in which I could put some data according to
> the behaviour of the method. I could not find any Holder class for such a
> type.
> I put the matching compilated class in my webapps / WEB-INF servlet
> directory (I pass over the web.xml config file for this) and edit my
> server-config.wsdd config file to define my service (I just put the
> interesting part, at least I hope it is interesting). :
> <service name="Service" provider="java:RPC">
>   <parameter name="allowedMethods" value="*"/>
>   <parameter name="scope" value="request"/>
>   <parameter name="className" value="Service"/>
>     <operation name="WS_MakeSomething">
>       <parameter name="a" mode="IN"/>
>       <parameter name="array" mode="OUT"/>
>     </operation>
> </service>
> And after restarting Tomcat, when I try to access the automatically
> generated WSDL with http://myserver:8081/Service?wsdl , I get the nice
> following error :
> "Illegal argument passed to ParameterDesc.setJavaType.  The java type [I
> does not match the mode out"
> From what I understand Axis is not really happy to read my wsdd file where
> it's asked to set a primitive array as an output parameter.
> I think I know how to create a Bean and wrap this array in something like
> MyIntArrayHolder but I just consider this a bit complicated just to get an
> output int array.
> So, I am wrong wanting my int[] to be an output and do I need to write my
> Bean Holder, or is there something else I missed ?
> Thanks in advance if any answers.
> -- Lisurc

View raw message