You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Banck, Arent-Jan" <aj...@informatica.com> on 2004/06/16 12:44:10 UTC

How to add types to Axis 1.2 deployment descriptor?

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.
 
Situation: Two data-objects, one extends the other. One result that has
an array of the base class. Method returns an the result type that
contains an array with type of the base class, but elements of the array
are the derived objects:
 
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;
  }
}
 
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
<http://common.services.api4.ias.informatica.com> "
               languageSpecificType="DerivedObject"/>