Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable auto generated JAX-WS Status Page

When I deploy and run my web service developed with JAX-WS I can see a summary page with some info on it, something like in this picture:

http://www.mkyong.com/webservices/jax-ws/deploy-jax-ws-web-services-on-tomcat/Web service status page

For the final implementation we would like to remove this page so that a custom or a blank page is returned while still having access to the web service endpoint.

We are currently running on Tomcat.

like image 844
user2722197 Avatar asked Oct 03 '22 03:10

user2722197


1 Answers

There is a field on the WSServlet class that might do what you are looking for: JAXWS_RI_PROPERTY_PUBLISH_STATUS_PAGE (it's value is com.sun.xml.ws.server.http.publishStatusPage).

Looking at the source code from a JAX-WS download it seems that you need to set it as a context parameter in your web.xml file:

<web-app>
  <context-param>
     <param-name>com.sun.xml.ws.server.http.publishStatusPage</param-name>
     <param-value>false</param-value>
  </context-param>
  ...

Seems that HttpAdapter had something similar on it but was taken from an environment variable:

setPublishStatus(
    System.getProperty(HttpAdapter.class.getName() + ".publishStatusPage")
    .equals("true"));

The code on HttpAdapter is marked deprecated in the javadoc so the context parameter seems the way to go.

like image 86
Bogdan Avatar answered Oct 07 '22 18:10

Bogdan