How do I add classes
to the deploment / type section of the generated WSDL?
With Java2WSDL I can
specify --extraClasses to add a class name, but I can't find how to add classes
using the WSDD description. The classes are in the wsdd as beanmappings, but
Axis 1.2 seems to remove them anyway.
public class BaseObject {}
public class DerivedObject
extends BaseObject implements java.io.Serializable {}
public class SearchResult
implements java.io.Serializable {
public class SearchResult
implements java.io.Serializable {
private
ArrayList foundObjects;
public
SearchResult() { foundObjects = new
ArrayList(); }
public
BaseObject[] getFoundObjects() {
return (BaseObject[]) foundObjects.toArray(new BaseObject[0]);
}
public void
setFoundObjects(BaseObject[] aBaseObject)
{ foundObjects = new
ArrayList(Arrays.asList(aBaseObject)); }
public void
addFoundObject(BaseObject aBaseObject)
{
foundObjects.add(aBaseObject); }
}
public class
SearchObjects {
public SearchResult search() {
SearchResult result = new SearchResult();
result.addFoundObject(new DerivedObject () );
return result;
}
}
public SearchResult search() {
SearchResult result = new SearchResult();
result.addFoundObject(new DerivedObject () );
return result;
}
}
When reading the generated wsdl
through the service (services/myservice?wsdl) only BaseObject/ArrayOfBaseObject
and SearchResult are in the types section. In Axis 1.1 all defined mappings are
included, so also BaseObject
When using the method, I get an
SAXException: Invalid element on the properties of the derived
object.
In WSDD:
<beanMapping
qname="ipa:SearchResult" xmlns:ipa="http://common.services"
languageSpecificType="java:SearchResult"/>
<beanMapping qname="ipa:BaseObject" xmlns:ipa="http://common.services"
languageSpecificType="BaseObject"/>
<beanMapping qname="ipa:DerivedObject" xmlns:ipa="http://common.services"
languageSpecificType="DerivedObject"/>
languageSpecificType="java:SearchResult"/>
<beanMapping qname="ipa:BaseObject" xmlns:ipa="http://common.services"
languageSpecificType="BaseObject"/>
<beanMapping qname="ipa:DerivedObject" xmlns:ipa="http://common.services"
languageSpecificType="DerivedObject"/>
