I have a question about axis2.  I was in the process of evaluating axis 1.3 for a project and I noticed that axis2 was released.  Axis2 has some very attractive features, but I have one large question I need answered.

Assume this very simple object structure.

public class Customer
{
        private String name;
        private int id;
       
        public Customer( String name, int id )
        {
                setName( name );
                setId( id );
        }
       
        public int getId() { return id; }
        public void setId( int id ) { this.id = id; }
       
        public String getName() { return name; }
        public void setName( String name ) { this.name = name; }
}

public class CustomerManager
{
        Customer getCustomer( int id )
        {
                return new Customer( "default", id );
        }
}    
     

So basically I have a customer that has a name and an id and I have a dummy manager class that will simulate accessing some data store of customers.  What I want to do is have a web service that exposes the CustomerManager.getCustomer( int ) method.  The idea being that the web service client could use the service to get a customer object based on its "id".

The end goal would be that the client would have some class that has a method called getCustomer which takes and returns a customer object.  While looking at axis2 I can't seem to do this.  I did manage to create the WSDL using the wsdl generation utility for the above example.  However when I try to generate the client I get a class that has a method that looks something like this.

GetCustomerResponse getCustomer( GetCustomer )

This is not very user friendly.  Is this a symptom of the automatic WSDL generation or is this the only way to produce a client in Axis2.  Note that I don't necessarily mean that the return object called "Customer" has to be the same object as listed about.  It can be a newly generated class that has the same basic bean style getters and setters.  I would really like to offer the consumer of the web service and API that includes a Customer class with nice getters and setters and a "manager" class that takes an int as an input and produces a customer as an output.

I could do this with Axis1.3.  Is this functionality not possible in Axis2.  Do I have to manually wrap the generated web services client with classes to conform to the API I want (this would defeat the purpose of WSDL and also require to create a distribution for multiple platforms, negating the advantage of web services in the first place).  Any help or ideas would be greatly appreciated.  Thanks.


Michael MacFadden
Tomax Corp - http://www.tomax.com
[EMAIL PROTECTED]


The views, opinions, and judgments expressed in this message are solely those of the author. The message contents have not been reviewed or approved by Tomax Corporation .

Reply via email to