Re: Axis2 Client Question

2006-05-08 Thread Anne Thomas Manes
Michael,I find it easier to think of SOAP as something more like JMS than RMI. That gets you into the mindset of document-oriented messages and loosely coupled connections and away from the distributed objects mindset. Nonetheless, Axis1/2 will happily generate an interface that looks and feels more like RMI. The catch is that Axis1/2 doesn't support a lot of features that you should expect from a distributed object system, like remote references. It's just something to be aware of.
Using document-oriented messages doesn't force your application to manipulate the SOAP message directly. Axis 1/2 will convert the messages into Java objects for you. My point is that SOAP is a very heavy protocol, so it's a good idea to create "chunky" rather than "chatty" interfaces -- you want to reduce the number of message exchanges, so you don't want to expose getter and setter methods on each object attribute.
If I haven't answered your outstanding questions, please ask them again.AnneOn 5/8/06, [EMAIL PROTECTED]
 <[EMAIL PROTECTED]> wrote:

I figured out a lot of my problems were
infact a result of the WSDL.  I have updated it to get more of what
I want.  My last post still has some questions in it that are valid.


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



Re: Axis2 Client Question

2006-05-08 Thread mmacfadden

I figured out a lot of my problems were
infact a result of the WSDL.  I have updated it to get more of what
I want.  My last post still has some questions in it that are valid.


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

Re: Axis2 Client Question

2006-05-08 Thread mmacfadden

Thanks for the info.  I guess I
am used to the RPC style web services model.  With axis1 the plan
was to expose a specific API for web services.  The internal object
model of the application would not be exposed directly.  Rather a
well thought out API would be constructed.  Then that API would be
made available as Web Services.  The client would have an API to work
with rather than working with documents.  This would seem to minimize
the amount of code an end user would have to write to consume the web service.

Sending documents across doesn't seem
to be much more convenient that just documenting a particular soap messaging
scheme and letting the end user use soap directly.  The only major
benefit seems like they get a WSDL that they can use to create a set of
object to manipulate the soap message according to a schema.  However,
they still are just configuring the soap message.  I realize the same
thing happens in the RPC style web services, but the with RPC the client
has a nicer API (IMO) that they can immediately understand.

I could certainly write a set of classes
that would wrap the code generated by Axis2, but then I would have to do
that ahead of time and ship that with the system providing the web services.
 That would seem to defeat the benefit of all of those WSDL to source
code generation utilities built into popular IDE's.  I can I manually
create a WSDL that will achieve what I want and that will work with Axis2?
 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
.


Anne Wrote:

First -- a comment about document-oriented systems versus
object-oriented systems. In SOA, it's generally considered a good idea
to expose coarse-grained interfaces rather than fine-grained interfaces.
Your goal is not to expose an object, but to expose a service. In other
words, your service interface should not expose getter and setter methods
for each attribute in your object structure. 

Second -- Axis2 does not currently support the "wrapped" convention
-- i.e., constructing a wrapper element for your method parameters (the
element name being the same as the operation name) and automatically unwrapping
that element for the application. Therefroe your application must do the
unwrapping itself. 

If you use java2wsdl, Axis2 will generate in input message element that
has the same name as the operation, which is defined as a sequence of your
input parameters, and an output message element called Response.
If you don't like this mnamign convention, you can hand-craft your own
WSDL and generate your Java code from it. 

Anne


Re: Axis2 Client Question

2006-05-08 Thread Anne Thomas Manes
First -- a comment about document-oriented systems versus object-oriented systems. In SOA, it's generally considered a good idea to expose coarse-grained interfaces rather than fine-grained interfaces. Your goal is not to expose an object, but to expose a service. In other words, your service interface should not expose getter and setter methods for each attribute in your object structure. 
Second -- Axis2 does not currently support the "wrapped" convention -- i.e., constructing a wrapper element for your method parameters (the element name being the same as the operation name) and automatically unwrapping that element for the application. Therefroe your application must do the unwrapping itself.
If you use java2wsdl, Axis2 will generate in input message element that has the same name as the operation, which is defined as a sequence of your input parameters, and an output message element called Response. If you don't like this mnamign convention, you can hand-craft your own WSDL and generate your Java code from it.
AnneOn 5/8/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]
> wrote:


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
.




Axis2 Client Question

2006-05-08 Thread mmacfadden


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
.