Willie,

Found my problem. Thought I would pass it on. 

I thought the error was occurring on the client during deserialization
but it was actually occurring on the on the server on my return
statement. Didn't see it earlier because it was after my logging
statements. Anyway my return used to be:

return (UserBean[])vectorUserBean.toArray(); 

I changed it to:

return (UserBean[])vectorUserBean.toArray(new
UserBean[vectorUserBean.size()]);

This actual specifies for the toArray() method to return objects of type
UserBean instad of Object

Thanks for your help

-----Original Message-----
From: Wille Faler [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 23, 2005 2:13 PM
To: bjmallow
Cc: [email protected]
Subject: Re: .Net and Axis interoperability

Looks ok. If it compiles and runs ok "without" Axis and SOAP it should
run ok with Axis as well.

This is of course assuming that UserBean only contains allowed
attributes as mentioned in the earlier mail, or at least only beans
which in turn only contain allowed attributes.

Keep that link I sent you handy, it's quite useful, I still refer to it
from time to time. :)

regards
Wille

On 6/23/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Wille
> 
> Thank you for the response. Another question if I may. Below is the 
> code where I used to be returning a Vector. I changed it to return an 
> array of UserBean objects. I remember trying this before but got a 
> class cast exception. Should this work?
> 
> Thanks
> Brad
> 
>     public UserBean[] getListOfUsers()
>         throws RemoteException
>     {
>         final String methodName = "getListOfUsers";
> 
>         mLogger.entering(className,methodName);
>         Vector vectorUserBean = new Vector();
>         try
>         {
>           while
>                 {
>                         code to get each employee and create a 
> UserBean object and it to the
>                         vectorUserBean
>                 }
> 
>           } catch ....
> 
> 
>         return (UserBean[])vectorUserBean.toArray();
>         }
> 
> 
> -----Original Message-----
> From: Wille Faler [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 22, 2005 9:39 AM
> To: [email protected]
> Subject: Re: .Net and Axis interoperability
> 
> Are you using a Vector-class to keep your employee-objects?
> That is a big no-no in Web Services if you don't want your service to 
> only be accessible to other Java Axis-clients.
> You should avoid using any Java-proprietary Collections, Hashmaps etc 
> and prefer using Arrays.
> The rule basically is: only use javabean objects or arrays of javabean

> objects that consist of "SOAP-native" datatypes.
> A list of possible types are found at:
> http://ws.apache.org/axis/java/user-guide.html#HowYourJavaTypesMapToSO
> AP
> XMLTypes
> 
> regards
> Wille Faler
> 
> On 6/22/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> >
> > I created an Axis WEB service (RPC) and am returning a custom class 
> > (Employee information). One of the methods I expose is
getListOfUsers.
> 
> > The method returns an array of Vector that contains Employee
objects.
> > My Java client works correctly. We have written a c# client to 
> > access the same service. However in the c# environment we are 
> > getting a cast exception. We let .Net create the initial client by 
> > pointing to the
> wsdl URL.
> >
> > Was wondering if anyone new how this should be cast.
> >
> > Brad
>

Reply via email to