for
public class Cheque implements java.io.Serializable {
Integer id;
Customer customer;
List
public get List
return chequeRows;
}
//no setter for chequeRows is used
//instead getChequeRows().add() is used to add cheque rows to the list
//...
}
and the result xsd does not have chequeRow elements
to force it - annotation @XMLElement is used:
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlElement;
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
public class Cheque implements java.io.Serializable {
@XmlElement
Integer id;
@XmlElement
Customer customer;
@XmlElement
List
public get List
return chequeRows;
}
//no setter for chequeRows is used
//instead getChequeRows().add() is used to add cheque rows to the list
//...
}
also, it is necessary to use @WebParam and @WebResult annotations with name="
targetNamespace has to be specified though
No comments:
Post a Comment