> Why can't one define a complexType with a <restriction > base="<stateful-bean-type>"/> > in WSDL. This should work right?
Of course you can do so. But the call semantics are not what I would expect. The types used as parameters to SOAP calls (more precisely JAX-RPC calls) contain only their attributes - no other methods than getters/setters. A statefull session bean is in general characterized by the business methods it exposes. If you use a reference to such a bean as a parameter in another EJB's method, the other side of the call can use that transferred reference to invoke the original bean remotely. By contrast the corresponding type transmitted as a SOAP-Parameter would contain only the attributes and none of the business methods. In general a session bean should be mapped to a service. The methods of the session bean should not use remote references to other enterprise beans. But instead a DataTransferObject should be used for any complex parameter type (see the j2ee patterns site for a description: http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.html ) If you really need to transfer remote references to web services, you could do so by transferring the service description and/or the service endpoint address as an ordinary type (string or URL). In thas case, the bean must be exposed as a web service either. Bye, Uli
