您是否在Web服务请求中指定了具体的实现?这对我来说很好:
抽象基类:
@XmlSeeAlso({Foo.class, Bar.class})public abstract class Foobase{ ...}实现类:
@XmlRootElement(name = "foo")public class Foo extends Foobase{ ...}Web服务方法:
public String getFoo(@WebParam(name = "param") final Foobase foo){ ...}请求:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.example/"> <soapenv:Header/> <soapenv:Body> <ser:getFoo> <param xsi:type="ser:foo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> </ser:getFoo> </soapenv:Body></soapenv:Envelope>



