有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java如何隐藏javabean中的方法,使其不出现在wsdl中

我有一个JavaBean类

class LineInfoBean{
  //Methods 

   method a() //Appears in the wsdl definition

   ....
   ....

   method b()//Appears in the wsdl definition -> I want to hide it from appearing in the wsdl


}

是否有一种方法可以隐藏方法b,使其不会出现在wsdl定义中。我尝试在方法上使用注释@WebMethod(exclude=true),但它不起作用。有没有办法隐藏这个方法


共 (1) 个答案

  1. # 1 楼答案

    不要把@WebMethod注释放在这个方法上,而是放在其他应该出现在WSDL中的方法上