I have am object model that exposes APIs. Most objects have corresponding
APIs for "get", "add", and "edit".

The "get" APIs return a standard JavaBean object.
The "add" APIs accept an "add" interface with get/set pairs and return the
ID of the new object.
The "edit" APIs accept an "edit" interface with get/set pairs and return the
ID of the edited object.

So, let's say I am working with object Foo. I would have the following APIs:

public FooBean getFoo(int id);
public int addFoo(AddFooMessage message);
public int editFoo(EditFooMessage message);

FooBean implements the AddFooMessage and EditFooMessage interface. Thus:

/**
 * @jboss-net.xml-schema urn="attask:FooBean"
**/
public class FooBean implements AddFooMessage, EditFooMessage {...}

There are many fields in the FooBean that are not needed or used in an "add"
request, so the AddFooMessage interface is defined to communicate what
properties are relevant for an "add". Thus:

/**
 * @jboss-net.xml-schema urn="attask:AddFooMessage"
**/
public interface AddFooMessage extends java.io.Serializable { ... };

In most cases (but not all) the EditFooMessage contains all the same fields
as an "add" message, except that ID is required. Thus:

/**
 * @jboss-net.xml-schema urn="attask:EditFooMessage"
**/
public interface EditFooMessage extends AddFooMessage { public int
getID();public void setID(int val); }

As you can guess, I am using XDoclet to create my SOAP web services that
bind to EJB implementation classes. (would also be interested in an answer
to the other thread about SOAP Service names getting rid of "Local" in the
name....)

What I have noticed about the WSDL generation done by Axis is:

1. FooBean is created as a complexType just fine. If FooBean extends another
class, this also works.

2. AddFooMessage is created as a complexType as long as it extends
java.io.Serializable. Otherwise, it complains about the lack of a default
constructor (weird message as this is an interface, not a class). As long as
you include this, it seems to work fine.

3. EditFooMessage is created as a complexType, but the ONLY FIELD IT HAS is
"ID"! The fact that it inherits from AddFooMessage is not captured. This
behavior is different from how classes work. With classes, the superclasses
are identified apprioriately.

My question is, is there a way to force Axis to recognize that
EditFooMessage is a subinterface of AddFooMessage and to generate the WSDL
appropriately? The only workaround I have now is to now use inheritance so
that the WSDL will generate correctly. This is doable, but very klunky.

Any ideas out there?

Nate Bowler





-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to