I have a web service that works as follows:
@WebService(serviceName = "TempService")
public class TempService {
@WebMethod(operationName = "addBarkod")
public Boolean addBarkod(@WebParam(name = "barkod") Barkod barkod) {
System.out.println(barkod.getBarkodNo());
}
}
and barcode class like:
public class Barkod {
private String barkodNo;
}
With this structure, my web service can be called using soapUI without any problems. the problem is when I want to annotate a model class with JAXB annotations, for example:
@XmlType(name="barkod")
@XmlRootElement(name="barkod")
@XmlAccessorType(XmlAccessType.FIELD)
I can deploy this to Glassfish 3.1, and soapUI generates a new client request with a new structure, but when it comes to "barkod.getBarkodNo ();" when addBarkod is running, it throws a NullPointerException. It seems to me that the XML sent to the web service does not create a suitable Barkod object.
Am I related to a web services class or something else?
source
share