java - JAXB "(variable) is not a valid property" on a ResponseWrapper -
i have webservice:
@webservice() public interface wmcservice { @webmethod(operationname="getgroupinfofromuserid") @responsewrapper(classname="wmc.web.service.basicgroupwrapper") @webresult(name="basicgroup") basicgroup getgroupinfofromuserid(@webparam(name = "id") long id); } @webservice(endpointinterface="wmc.web.service.wmcservice", servicename="wmcservice") public class wmcserviceimpl implements wmcservice { @override public basicgroup getgroupinfofromuserid(long id) { userhelper uh = new userhelper(); wmcuser user = uh.getbyid(id); if (user != null) { return user.getbasicgroup(); } else { return null; } } }
and have responsewrapper:
@xmlrootelement() @xmltype(name="group") @xmlaccessortype(xmlaccesstype.field) public class basicgroupwrapper { @xmlelement(name="groupname") private string groupname; @xmlelement(name="groupid") private long groupid; @xmltransient private basicgroup basicgroup; public string getgroupname() { return groupname; } public void setgroupname(string groupname) { this.groupname = groupname; } public long getgroupid() { return groupid; } public void setgroupid(long groupid) { this.groupid = groupid; } public void setbasicgroup(basicgroup group) { this.groupname = group.getgroupname(); this.groupid = group.getid(); this.basicgroup = group; } public basicgroup getbasicgroup() { return basicgroup; } }
when test operation following error can't google solution to. maybe can help.
caused by: javax.xml.bind.jaxbexception: basicgroup not valid property on class wmc.web.service.basicgroupwrapper @ com.sun.xml.bind.v2.runtime.jaxbcontextimpl.getelementpropertyaccessor(jaxbcontextimpl.java:971) @ com.sun.xml.ws.server.sei.endpointresponsemessagebuilder$doclit.<init>(endpointresponsemessagebuilder.java:203) ... 34 more
@webresult(name="basicgroup")
not part of wsdl since it's marked xmltransient
:
@xmltransient private basicgroup basicgroup;
so won't able pick out part of response.
Comments
Post a Comment