title: Generating Java files from multiple WSDL files
body: <p>I'm currently involved in a project where we have to integrate our system to an external system. The company responsible for the external system have provided us multiple WSDL and corresponding XSD files (Over 100 WSDL files). Each WSDL file contains information about various services and the XSD files contains information about the types used for each service. </p>
  
  <p>The problem I'm currently facing is when I'm generating Java classes from these XSD files. Many of the XSD files contains the same type. Lets say that almost all of these XSD files contains information about "User". The User type is identical in all the XSD files and have the same namespace. When generating Java classes from these WSDL files and placing them in different packages, I end up with over hundred version of the same class. If I put all the Java classes in the same package, I override ObjectFactory.</p>
  
  <p>So when I generate Java classes from one WSDL file, the result will be in about hundred Java classes. Fifty of these classes are the same in all the other WSDL files and the rest are unique for just that WSDL file.</p>
  
  <p>My question is the following: What is the best practice to handle these kind of scenarios? Would it be possible to merge all these WSDL files into one file and then generate classes from that? Or when I'm generating the Java classes, would it be possible to extract all the common classes into a separate package?</p>
  
  <p>At the moment we use Apache CXF and Maven (cxf-codegen-plugin) to generate our classes and then do some manual work. However, I believe there should be a more efficient method to handle this.</p>
  
  <p>I appreciate all the help I can get on the problem.</p>