I need to either hide the WSDL url or only make it available for authenticated users . I.e I don't want to expose http://localhost:8080/services/Application?wsdl.
Tomcat version 8.5.11, java 8, Axis 1.4 (I know the Axis version is too old but that is what I have to work with for now )
I thought I could add a security constraint to web.xml as explained on here http://docs.oracle.com/cd/E19798-01/821-1841/bncbk/index.html as follow:
<security-constraint>
<web-resource-collection>
<web-resource-name>WSDL</web-resource-name>
<description>WSDL Files</description>
<url-pattern>*?wsdl</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>*</role-name>
</auth-constraint>
</security-constraint>
Also found this thread which suggest to do the same thing but not working for me Hiding WSDL in JAX-WS
Tomcat throws the following error:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3782)
at org.apache.catalina.startup.HostConfig.reload(HostConfig.java:1377)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1350)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1586)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:280)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1164)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1388)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1392)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1360)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: Invalid <url-pattern> *?wsdl in security constraint
at org.apache.catalina.core.StandardContext.addConstraint(StandardContext.java:2827)
at org.apache.catalina.startup.ContextConfig.configureContext(ContextConfig.java:1317)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1190)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:775)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5087)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 11 more
Any idea what I am doing wrong? or how I can achieve the above?
Many thanks in advance