可以通过在 Axis 中将“disableServiceList”设置为 true 来禁用所有已部署服务的列表;在 AxisServlet.java -> reportAvailableServices() 中使用。
但是,有没有办法禁用对 wsdls 的访问?
有几种方法可以做到这一点。一种方法是编写一个过滤器来处理“wsdl”
http://www.coderanch.com/t/224470/Web-Services/java/Disable-wsdl-url-Axis#1054987
您可以在 axis2.xml 配置文件中的 URL (?wsdl) 中禁用服务列表:
<!--
The exposeServiceMetadata parameter decides whether the metadata (WSDL, schema, policy) of
the services deployed on Axis2 should be visible when ?wsdl, ?wsdl2, ?xsd, ?policy requests
are received.
This parameter can be defined in the axis2.xml file, in which case this will be applicable
globally, or in the services.xml files, in which case, it will be applicable to the
Service groups and/or services, depending on the level at which the parameter is declared.
This value of this parameter defaults to true.
-->
<parameter name="exposeServiceMetadata">false</parameter>