Defining multiple endpoints for multiple soap web services in spring boot application

≡放荡痞女 提交于 2021-01-29 17:40:07

问题


I have a servlet mapping issue in spring boot application with multiple soap web services. I have two (or more) WebServices with different mappings.

Service A -> Endpoint1 Service B -> Endpoint2

Once I deploy spring boot application with two MessageDispatcherServlets , Service A and B both can be accessed with Endpoint1 only. I don't know how I can map Endpoint1 url to ServiceA and Endpoint2 to ServiceB.

Please check sample of my code for Service-A. Code is similar for Service-B.

     @Bean(name = "ServiceA")
        public Wsdl11Definition wsdl11DefinitionImportAgent() {
            SimpleWsdl11Definition simpleWsdl11Definition = new SimpleWsdl11Definition();
            simpleWsdl11Definition.setWsdl(new ClassPathResource("/wsdl/ServiceA.wsdl"));
            return simpleWsdl11Definition;
        }  

@Bean
    public ServletRegistrationBean messageDispatcherServletServiceA(ApplicationContext 
      applicationContext) {
        MessageDispatcherServlet servlet = new MessageDispatcherServlet();
        servlet.setApplicationContext(applicationContext);
        servlet.setTransformWsdlLocations(true);
        return new ServletRegistrationBean(servlet, "/ws/ServiceA");
    }

 

来源:https://stackoverflow.com/questions/63899640/defining-multiple-endpoints-for-multiple-soap-web-services-in-spring-boot-applic

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!