axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vesa Luomala (JIRA)" <axis-...@ws.apache.org>
Subject [jira] Updated: (AXIS-2669) java.lang.ArrayStoreException if you have methods that return same object type in array and single type
Date Wed, 30 May 2007 12:49:16 GMT

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

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>
// Same ProgramCard object here
import xx.yy.ProgramCard;
...
    @WebMethod
    public ProgramCard getProgramCardByProgramCardNumber(String cardNumber, Identification
callParams) throws java.rmi.RemoteException, NotFoundException, FunctionalException, TechnicalException
{
.....

AND

    @WebMethod
    public ProgramCard[] getActiveProgramCardsByCustomerId(String[] ids, Identification callerId)
throws java.rmi.RemoteException, NotFoundException, FunctionalException, TechnicalException
{
.....

</server>

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.jaws.ProgramCard[] getActiveProgramCardsByCustomerId(...

AND

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

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

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

The code (used with Java 1.5 annotations):

<server-side>
// Same ProgramCard object here
import xx.yy.ProgramCard;
...
    @WebMethod
    public ProgramCard getProgramCardByProgramCardNumber(String cardNumber, Identification
callParams) throws java.rmi.RemoteException, NotFoundException, FunctionalException, TechnicalException
{
.....

AND

    @WebMethod
    public ProgramCard[] getActiveProgramCardsByCustomerId(String[] ids, Identification callerId)
throws java.rmi.RemoteException, NotFoundException, FunctionalException, TechnicalException
{
.....

</server>

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.jaws.ProgramCard[] getActiveProgramCardsByCustomerId(...

AND

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

</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)
> 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>
> // Same ProgramCard object here
> import xx.yy.ProgramCard;
> ...
>     @WebMethod
>     public ProgramCard getProgramCardByProgramCardNumber(String cardNumber, Identification
callParams) throws java.rmi.RemoteException, NotFoundException, FunctionalException, TechnicalException
{
> .....
> AND
>     @WebMethod
>     public ProgramCard[] getActiveProgramCardsByCustomerId(String[] ids, Identification
callerId) throws java.rmi.RemoteException, NotFoundException, FunctionalException, TechnicalException
{
> .....
> </server>
> 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.jaws.ProgramCard[] getActiveProgramCardsByCustomerId(...
> AND
> public com.teliasonera.paytv.ws.types.ProgramCard getProgramCardByProgramCardNumber(....
> </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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Mime
View raw message