java - JAX-WS Web service on Tomcat without sun-jaxws.xml -


i trying minimize required configuration while deploying jax-ws-based web service on tomcat. introduction of servlet 3.0 (supported tomcat 7+), web.xml can thrown out, there still sun-jaxws.xml. blog post interesting:

of course, use of jax-ws annotations, configuration sun-jaxws.xml can made optional making descriptor free, requires specifying default url-pattern in jsr-109 or custom pattern in jersey rest services, in jax-ws specification.

is possible avoid sun-jaxws.xml on tomcat, , how?

sadly, configuration must exist somewhere. mandatory, per source. believe or not, the location of sun-jaxws.xml file hard-coded /web-inf/sun-jaxws.xml (thanks, guys @ metro).

effectively, need take control of following classes


what needs happen:

  1. wsservletcontextlistener not extended. listener performs of initializations per sun-jaxws.xml , jaxws-catalog file. mentioned earlier, location hard coded. path of least resistance here

    • implement own vanilla servlet listener (with @weblistener) , call new wsservletcontextlistener(). you'll delegate own contextinitialized(servletcontext ctxt) , contextdestroyed() methods ones in instance of wsservletcontextlistener.

    • generate file on instantiation of listener, on fly, using @xmlrootelement class that'll represent sun-jaxws file(i'll provide sample of in short while, don't have time right :) ).

it's lot of trouble such dispensable convenience, imo, should work in theory. i'll write samples , see how play shortly.


Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -