How to use Tuckey urlrewrite in spring boot to access service using ?wsdl -


my clients wanted access wsdl using ?wsdl notation, springboot service have created working '.wsdl' format. need working example/sample how configure tuckey urlrewrite in springboot application. have tried using below code, application complaints cant find urlrewrite.xml (which have placed in src/main/resources folder.

q1: how can make service accessible using url below http://localhost:8080/ws/organisation?wsdl

i have tried using below code, tuckey cannot find urlrewrite.xml under src/java/resources.

@bean public filterregistrationbean tuckeyregistrationbean() {     final filterregistrationbean registrationbean = new ilterregistrationbean();     registrationbean.setfilter(new urlrewritefilter());     registrationbean.addinitparameter("confpath", "urlrewrite.xml");     return registrationbean; } 

finally figure out solution. reading urlrewrite.xml src/main/resources folder.

no need declare above mentioned bean definition in question post (public filterregistrationbean tuckeyregistrationbean()), below code declared @component automatically register context , url-rewriting performed.

@component public class wsdlurlrewritefilter extends urlrewritefilter {      private static final string config_location = "classpath:/urlrewrite.xml";      @value(config_location)     private resource resource;      @override     protected void loadurlrewriter(filterconfig filterconfig) throws servletexception {         try {             conf conf = new conf(filterconfig.getservletcontext(), resource.getinputstream(), resource.getfilename(), "");         checkconf(conf);         } catch (ioexception ex) {             throw new servletexception("unable load url-rewrite configuration file " + config_location, ex);         }     } } 

Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -