我有一个实现接口的 Bean 类。Bean 有几个方法,其中一些返回List<...>。Web 服务调用适用于所有不返回的方法List。但是,当我尝试调用返回的方法时,我得到一个肥皂错误字符串List。
这是我的界面
@WebService
public interface Cart {
     @WebMethod(operationName="getOptionsData")   
     public List<OptionsData> getOptionsData(int id,int searchYear);
 }
豆类
@WebService 
public Class CartBean implements Cart {
@WebMethod(operationName="getOptionsData")
public List<OptionsData> getOptionsData(int id,int searchYear) {
  return List<...>;
}
}
当我尝试使用我的 Web 服务调用它时,我收到以下响应消息。
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
 <soapenv:Body>
   <soapenv:Fault>  
      <faultcode>soapenv:Client</faultcode>
      <faultstring>A Java method was not found for the operation. If the 
                  WSDL operation name is different from the Java method name, 
                  make sure that the @WebMethod annotation name is present
      </faultstring> 
      <detail />
    </soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
我已将这两个注释都添加到我的实现类中。但是我不明白为什么只有返回List<...>和接受参数的方法没有被识别。返回List<..>空参数的方法被识别,我得到了预期的响应。是 SOAP 无法处理Lists还是有什么我实施它的方式有问题吗?有人帮我解决这个问题。。
提前致谢 !!