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#HowYourJavaTypesMapToSOAP
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