title: How to create a SOAP Web Service with multiple WSDL
body: <p>I'm currently modifying a few java (soap)Web Services, thats actually my 3rd WS ever! Here's the problem I'm encountring:
  For this one, I have to add a 2cd WSDL to the actual WS.</p>
  <p>I understand I have to deal with CXF to anable the WS to go through both WSDLs  here's what I've tried to do.</p>
  <p>I have taken care of the CXF plugin in POM.XML and declared the 2 WSDLs:</p>
  <pre><code> &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
                  &lt;artifactId&gt;cxf-codegen-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.3.1&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;generate-sources-info&lt;/id&gt;
                          &lt;phase&gt;generate-sources&lt;/phase&gt;
                          &lt;configuration&gt;
                              &lt;wsdlRoot&gt;${basedir}/src/main/resources/WSDL&lt;/wsdlRoot&gt;
                              &lt;includes&gt;
                                  &lt;include&gt;*.wsdl&lt;/include&gt;
                              &lt;/includes&gt;
                              &lt;sourceRoot&gt;${project.basedir}/src/main/generated-sources&lt;/sourceRoot&gt;
                              &lt;wsdlOptions&gt;
                                  &lt;wsdlOption&gt;
                                      &lt;suppressGeneratedDate&gt;true&lt;/suppressGeneratedDate&gt;
                                      &lt;wsdl&gt;${basedir}/src/main/resources/WSDL/1XXXService.wsdl&lt;/wsdl&gt;
                                      &lt;extraargs&gt;
                                          &lt;extraarg&gt;-verbose&lt;/extraarg&gt;
                                      &lt;/extraargs&gt;
                                      &lt;wsdlLocation&gt;/WSDL/1XXXService.wsdl&lt;/wsdlLocation&gt;
                                  &lt;/wsdlOption&gt;
                                  &lt;wsdlOption&gt;
                                      &lt;suppressGeneratedDate&gt;true&lt;/suppressGeneratedDate&gt;
                                      &lt;wsdl&gt;${basedir}/src/main/resources/WSDL/2XXX_Service.wsdl&lt;/wsdl&gt;
                                      &lt;extraargs&gt;
                                          &lt;extraarg&gt;-verbose&lt;/extraarg&gt;
                                          &lt;extraarg&gt;-p&lt;/extraarg&gt;
                                          &lt;extraarg&gt;com.as24.cxf.server.upa&lt;/extraarg&gt;
                                      &lt;/extraargs&gt;
                                      &lt;wsdlLocation&gt;/WSDL/2XXX_Service.wsdl&lt;/wsdlLocation&gt;
                                  &lt;/wsdlOption&gt;
                              &lt;/wsdlOptions&gt;
                          &lt;/configuration&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;wsdl2java&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
  </code></pre>
  <p>The classes were generated and i've implemented them correctly.</p>
  <p>Then I've added both WSDL in CFX-SERVLET.XML file :</p>
  <pre><code> &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;
         xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
         xmlns:jaxws=&quot;http://cxf.apache.org/jaxws&quot; xmlns:cxf=&quot;http://cxf.apache.org/core&quot;
         xsi:schemaLocation=&quot;
          http://www.springframework.org/schema/beans
          http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
          http://cxf.apache.org/jaxws
          http://cxf.apache.org/schemas/jaxws.xsd
          http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd&quot;&gt;
  
      &lt;cxf:bus&gt;
          &lt;cxf:properties&gt;
              &lt;entry key=&quot;org.apache.cxf.stax.maxChildElements&quot; value=&quot;100000&quot;/&gt;
          &lt;/cxf:properties&gt;
      &lt;/cxf:bus&gt;
      &lt;jaxws:endpoint id=&quot;1XXXService&quot; implementor=&quot;com.YYY.cxf.server.ZZZ.impl.1XXXServiceImpl&quot; address=&quot;/&quot;&gt;
          &lt;jaxws:properties&gt;
              &lt;entry key=&quot;org.apache.cxf.stax.maxChildElements&quot; value=&quot;100000&quot;/&gt;
          &lt;/jaxws:properties&gt;
      &lt;/jaxws:endpoint&gt;
      &lt;jaxws:endpoint id=&quot;2XXXService&quot; implementor=&quot;com.YYY.cxf.server.ZZZ.impl.2XXXServiceImpl&quot; address=&quot;/upa&quot;&gt;
          &lt;jaxws:properties&gt;
              &lt;entry key=&quot;org.apache.cxf.stax.maxChildElements&quot; value=&quot;100000&quot;/&gt;
          &lt;/jaxws:properties&gt;
      &lt;/jaxws:endpoint&gt;
  &lt;/beans&gt;
  </code></pre>
  <p>I'm still getting errors tho, when I silence the 2cd WSDL, the 1st one works perfectly but as soon as I add the 2cd one i get errors.</p>
  <p>The 1st errors is :</p>
  <pre><code>23-Aug-2022 18:00:11.313 GRAVE [http-nio-28080-exec-3] org.apache.catalina.core.ApplicationContext.log StandardWrapper.Throwable
  org.springframework.beans.factory.BeanCreationException: Error creating bean with name '2XXXService': Invocation of init method failed; nested exception is javax.xml.ws.WebServiceException: javax.xml.ws.WebServiceException: Could not load Webservice SEI
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1788)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:609)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:531)
      at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:923)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:588)
      at org.apache.cxf.transport.servlet.CXFServlet.createSpringContext(CXFServlet.java:174)
      at org.apache.cxf.transport.servlet.CXFServlet.loadBus(CXFServlet.java:76)
      at org.apache.cxf.transport.servlet.CXFNonSpringServlet.init(CXFNonSpringServlet.java:92)
      at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1144)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1091)
      at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:763)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:134)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:544)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
      at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
      at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:616)
      at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
      at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:831)
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1634)
      at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Thread.java:748)
  Caused by: javax.xml.ws.WebServiceException: javax.xml.ws.WebServiceException: Could not load Webservice SEI
      at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:375)
      at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:255)
      at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:543)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1914)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1856)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1784)
      ... 32 more
  Caused by: javax.xml.ws.WebServiceException: Could not load Webservice SEI
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
      at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
      at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:616)
      at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
      at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:831)
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1634)
      at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Thread.java:748)
  </code></pre>
  <p>heres the other error i got  :</p>
  <pre><code>Error creating bean with name 'blablabla': Invocation of init method failed; nested exception is javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: serviceClass must be set to a valid service interface or class
  </code></pre>
  <p>Could you help me please understand what are the steps needed to use multiple WSDL in ONE SOAP Web Service ?</p>
  <p>Crossing fingers!</p>
  <p>Many thanks in advance ! :)</p>