[ 
https://issues.apache.org/jira/browse/AXIS-2669?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Vesa Luomala updated AXIS-2669:
-------------------------------

    Description: 
I have noticed the following problem:

If I return the same object both in array and as single value, or if I have 
same object in array and as a parameter, then the method which returns an array 
does not work at client side but throws the exception below (at client side). 
Single object method works fine, also method with object as parameter. My 
sample object here is 'ProgramCard'

java.lang.ArrayStoreException: xx.yy.types.ProgramCard
 org.apache.axis.utils.JavaUtils.convert(JavaUtils.java:493)
 org.apache.axis.client.Call.invoke(Call.java:2537)
 org.apache.axis.client.Call.invoke(Call.java:2366)
 org.apache.axis.client.Call.invoke(Call.java:1812)
 
xx.yy.com.ws.ProgramCardServiceInterfaceBindingStub.getActiveProgramCardsByCustomerId(ProgramCardServiceInterfaceBindingStub.java:1035)

If I remove the method that returns one ProgramCard, then the array function 
works fine. It seems to me, that server side confuses arrayelements and single 
objects, if they occur in same webservice interface. arrayelements are given 
the wrong class: xx.yy.types.ProgramCard instead of xx.yy.jaws.ProgramCard when 
returned in the SOAP message and client side cannot reconstruct them

The code (used with Java 1.5 annotations):

<server-side>

...
    @WebMethod
    public xx.yy.ProgramCard getProgramCardByProgramCardNumber(...
.....

AND

    @WebMethod
    public xx.yy.ProgramCard[] getActiveProgramCardsByCustomerId(...
.....

</server-side>

when this is converted to WSDL and after that for clienside stubs, then single 
element and arrayelements are actually different objects:

<client side stub interface>

Generated code by Axis 1.4:

public xx.yy.types.ProgramCard getProgramCardByProgramCardNumber(....

AND

public xx.yy.jaws.ProgramCard[] getActiveProgramCardsByCustomerId(...

</client side stub interface>




  was:
I have noticed the following problem:

If I return the same object both in array and as single value, or if I have 
same object in array and as a parameter, then the method which returns an array 
does not work at client side but throws the exception below (at client side). 
Single object method works fine, also method with object as parameter. My 
sample object here is 'ProgramCard'

java.lang.ArrayStoreException: xx.yy.types.ProgramCard
 org.apache.axis.utils.JavaUtils.convert(JavaUtils.java:493)
 org.apache.axis.client.Call.invoke(Call.java:2537)
 org.apache.axis.client.Call.invoke(Call.java:2366)
 org.apache.axis.client.Call.invoke(Call.java:1812)
 
xx.yy.com.ws.ProgramCardServiceInterfaceBindingStub.getActiveProgramCardsByCustomerId(ProgramCardServiceInterfaceBindingStub.java:1035)

If I remove the method that returns one ProgramCard, then the array function 
works fine. It seems to me, that server side confuses arrayelements and single 
objects, if they occur in same webservice interface. arrayelements are given 
the wrong class: xx.yy.types.ProgramCard instead of xx.yy.jaws.ProgramCard when 
returned in the SOAP message and client side cannot reconstruct them

The code (used with Java 1.5 annotations):

<server-side>

...
    @WebMethod
    public xx.yy.ProgramCard getProgramCardByProgramCardNumber(...
.....

AND

    @WebMethod
    public xx.yy.ProgramCard[] getActiveProgramCardsByCustomerId(...
.....

</server-side>

when this is converted to WSDL and after that for clienside stubs, then single 
element and arrayelements are actually different objects:

<client side stub interface>

Generated code by Axis 1.4:

public com.teliasonera.paytv.ws.types.ProgramCard 
getProgramCardByProgramCardNumber(....

AND

public xx.yy.jaws.ProgramCard[] getActiveProgramCardsByCustomerId(...

</client side stub interface>





> java.lang.ArrayStoreException if you have methods that return same object 
> type in array and single type
> -------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS-2669
>                 URL: https://issues.apache.org/jira/browse/AXIS-2669
>             Project: Axis
>          Issue Type: Bug
>          Components: Basic Architecture
>    Affects Versions: 1.4
>         Environment: JBoss 4.0.5, JDK 1.5.0.11, XP
>            Reporter: Vesa Luomala
>
> I have noticed the following problem:
> If I return the same object both in array and as single value, or if I have 
> same object in array and as a parameter, then the method which returns an 
> array does not work at client side but throws the exception below (at client 
> side). Single object method works fine, also method with object as parameter. 
> My sample object here is 'ProgramCard'
> java.lang.ArrayStoreException: xx.yy.types.ProgramCard
>  org.apache.axis.utils.JavaUtils.convert(JavaUtils.java:493)
>  org.apache.axis.client.Call.invoke(Call.java:2537)
>  org.apache.axis.client.Call.invoke(Call.java:2366)
>  org.apache.axis.client.Call.invoke(Call.java:1812)
>  
> xx.yy.com.ws.ProgramCardServiceInterfaceBindingStub.getActiveProgramCardsByCustomerId(ProgramCardServiceInterfaceBindingStub.java:1035)
> If I remove the method that returns one ProgramCard, then the array function 
> works fine. It seems to me, that server side confuses arrayelements and 
> single objects, if they occur in same webservice interface. arrayelements are 
> given the wrong class: xx.yy.types.ProgramCard instead of 
> xx.yy.jaws.ProgramCard when returned in the SOAP message and client side 
> cannot reconstruct them
> The code (used with Java 1.5 annotations):
> <server-side>
> ...
>     @WebMethod
>     public xx.yy.ProgramCard getProgramCardByProgramCardNumber(...
> .....
> AND
>     @WebMethod
>     public xx.yy.ProgramCard[] getActiveProgramCardsByCustomerId(...
> .....
> </server-side>
> when this is converted to WSDL and after that for clienside stubs, then 
> single element and arrayelements are actually different objects:
> <client side stub interface>
> Generated code by Axis 1.4:
> public xx.yy.types.ProgramCard getProgramCardByProgramCardNumber(....
> AND
> public xx.yy.jaws.ProgramCard[] getActiveProgramCardsByCustomerId(...
> </client side stub interface>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to