java - Using WSDL, can we generate other public methods inside a class that is a parameter of a Web Service Method? -
sorry, if question not clarify need....please read ahead requirement.
i using jax-ws 2.2.3.
i have implemented web service class has method int addrecord(record). record class contains instance member collection of attribute class. now, record class contains public void addattribute(attribute objattribute) method.
i have generated wsdl class using wsgen ant task.
when wsimport on wsdl, alon gwith other classes, record class contains set/get methods instance member , not void addattribute(attribute objattribute) method.
is there way method on 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 process record object } }
no - not web services.
the system metaphor web services message passing. there client , server , exchange messages via pre-arranged communication protocol or contract. messages , exchanges described in wsdl.
what imagining distributed object system, transmit objects , not messages. not model web services tools (for platform) support.
consider changing architecture use dtos - data transfer objects - things exchanged. implement logic in different business-level objects maybe use adapter pattern slurp state dto. business objects shared data types, if like; in other words single jar defines type , gets referenced within client , within server.
Comments
Post a Comment