Sorry, if the question does not clarify exactly what i need....Please read ahead for the requirement.
I am using JAX-WS 2.2.3.
I have implemented a web service class which has a method int addRecord(Record). The Record class contains an instance member as collection of Attribute class. Now, the Record class contains a public void addAttribute(Attribute objAttribute) method.
I have generated the WSDL for this class using the wsgen ant task.
When i do a wsimport on this WSDL, alon gwith other classes, i only get a Record class that contains set/get methods for the instance member and not the void addAttribute(Attribute objAttribute) method.
Is there a way to get this method also on the Record class?
SOURCE CODE:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Record")
public class Record implements Serializable
{
/**
*
*/
private static final long serialVersionUID = 1L;
@XmlElement(name = "AttributeList")
List<Attribute> objAttributeList;
public void addAttribute(Attribute objAttribute)
{
objAttributeList.add(objAttribute);
}
}
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Attribute")
public class Attribute implements Serializable
{
@XmlElement(name = "Id")
int id;
@XmlElement(name = "Name")
String name;
@XmlElement(name = "Value")
Object value;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Object getValue() {
return value;
}
public void setValue(Object value) {
this.value = value;
}
}
@WebService
class RecordService
{
@WebMethod
public int addRecord(Record objRecord)
{
//code to process record object
}
}