javax.xml.bind.MarshalException
- by sandeep
Hi, I am getting javax.xml.bind.MarshalException error. I am sending List from my webservice to the backingbean and I have this error. Here is my code:
Backing bean
@WebServiceRef(wsdlLocation = "http://localhost:26565/Login_webserviceService/Login_webservice?WSDL")
public String login() {
System.out.println("Login Phase entered");
int result = 0;
List list;
List finalList = null;
try {
Weblogin.LoginWebserviceService service = new Weblogin.LoginWebserviceService();
Weblogin.LoginWebservice port = service.getLoginWebservicePort();
result = port.login(voterID, password);
Weblogin.LoginWebservice port1 = service.getLoginWebservicePort();
list = port1.candDetails(1);
finalList = list;
this.setList(finalList);
} catch (Exception e) {
e.printStackTrace();
}
if (result == 1)
return "polling";
else
return "login";
}
Webservice
public List candDetails(int pollEvent) {
List resultList = null;
List finalList = null;
try {
if (pollEvent == 1) {
resultList = em.createNamedQuery("Cantable.findAll").getResultList();
finalList = resultList;
}
} catch (Exception e) {
e.printStackTrace();
}
return resultList;
}