code: @SuppressWarnings("unchecked")
     protected void publishWsdlImports(URL parentURL, Definition parentDefinition, List<String> published, String expLocation) throws Exception
     {
        @SuppressWarnings("rawtypes")
        Iterator it = parentDefinition.getImports().values().iterator();
        while (it.hasNext())
        {
           for (Import wsdlImport : (List<Import>)it.next())
           {
              String locationURI = wsdlImport.getLocationURI();
              // its an external import, don't publish locally
              if (locationURI.startsWith("http://") == false && locationURI.startsWith("https://") == false)
              {
                 // infinity loops prevention
                 if (published.contains(locationURI))
                 {
                    continue;
                 }
                 else
                 {
                    published.add(locationURI);
                 }
                 
                 String baseURI = parentURL.toExternalForm();
                 URL targetURL = new URL(baseURI.substring(0, baseURI.lastIndexOf("/") + 1) + locationURI);
                 File targetFile = new File(targetURL.getFile()); //JBWS-3488
                 createParentDir(targetFile);
  
                 Definition subdef = wsdlImport.getDefinition();
                 WSDLFactory wsdlFactory = WSDLFactory.newInstance();
                 javax.wsdl.xml.WSDLWriter wsdlWriter = wsdlFactory.newWSDLWriter();
                 BufferedOutputStream bfos = new BufferedOutputStream(new FileOutputStream(targetFile));
                 OutputStreamWriter osw = new OutputStreamWriter(bfos, "UTF-8");
                 try {
                    wsdlWriter.writeWSDL(subdef, osw);
                 } finally {
                    osw.close();
                 }
  
                 DEPLOYMENT_LOGGER.wsdlImportPublishedTo(targetURL);
  
                 // recursively publish imports
                 publishWsdlImports(targetURL, subdef, published, expLocation);
  
                 // Publish XMLSchema imports
                 Element subdoc = DOMUtils.parse(targetURL.openStream(), getDocumentBuilder());
                 publishSchemaImports(targetURL, subdoc, published, expLocation);
              }
           }
        }
     }
docs: Publish the wsdl imports for a given wsdl definition