Ant.jwsc converting to gradle

Error while calling ant.jwsc

doFirst {
      ant.taskdef(name: "jwsc",
         classname: "weblogic.wsee.tools.anttasks.JwscTask",
         classpath: configurations.antJwsc.asPath)
         
      ant.jwsc(
               srcdir: "${buildDir}/webservices",  
               destdir: "${buildDir}/soawar",
               includeantruntime: "false",
               classpath: configurations.compileClasspath + 
                          configurations.jwsc.asPath) {
      	 
			      module(name: "testservices", explode: "true") {
			         jwsfileset(srcdir: "${buildDir}/webservices/com/testing/testingeb") {
		            	include name: "**/*.java"   
			         }
		             descriptor file: "${projectDir}/webservices/config/web.xml"          
		          }
		          	               
		          binding(dir: "${rootDir}/services/xml") {
		          	includes = ["**/*.xsdconfig"]
		          	exclude name: "**/*.html"
		          	exclude name: "*.spp"
		          	exclude name: "**/*.xml"
		          	exclude name: "**/*.xsd"
		          	exclude name: "**/*.xsl"
		          	exclude name: "**/*.xslt"
		          }      
      		   }
   }   
   
   from "${buildDir}/soawar"
      
   archiveBaseName = "ldev"
    
   destinationDirectory.set(file("${buildDir}/ear"))
   
   webXml = file("${projectDir}/config/web.xml") 
    
   classpath = fileTree("${rootDir}/lib/3rd-party/sun/jnlp/1.5")
}

Error:

[ant:jwsc] JWS: suite\services\soa\build\webservices\com\testing\testeb\transaction\webservices\TransactionService.java Validated.
[ant:jwsc] com.bea.xml.XmlException: com.bea.xml.XmlException: error: Use of undefined namespace prefix: xsl
[ant:AntUtil.deleteDir] Deleting directory AppData\Local\Temp\_7oy6jr1

That’s a message from inside the Ant task you are using.
I doubt anyone in this forum can help you with that, as it is not a Gradle problem.

The issue turned out to be how the classpath was parsed and interpreted. Moving the classpath out of the parameter list and into the body solved the issue.

 doFirst {   
      ant.taskdef(name: "jwsc",
         classname: "weblogic.wsee.tools.anttasks.JwscTask",
         classpath: configurations.antJwsc.asPath)

      ant.jwsc(applicationXml: "${buildDir}/application.xml",
         srcdir: "${buildDir}/webservices",
         destdir: "${buildDir}/awar",
         includeantruntime: "false") {
         classpath {
            pathelement(location: "${weblogicHome}/server/lib/weblogic.jar")
            pathelement(path: "${buildDir}/classes")
            fileset(dir: "${buildDir}/classes") {include name: "**/*.class"}
            pathelement(location: "${rootDir}/lib/commonlib/commonlib.jar")
            fileset(dir: "${rootDir}/lib/xml") {include name: "*.jar"}
            dirset(dir: "${rootDir}/services/xml") {include name: "*"}
         }
         module(name: "ebservices", explode: "true") {
            jwsfileset(srcdir: "${buildDir}/webservices") {
               include name: "**/*.java"
            }
            descriptor file: "${projectDir}/config/web.xml"
         }
         binding(dir: "${rootDir}/services/xml") {
            include name:"**/*.xsdconfig"
         }
      }
   }

Personally I’d move this classpath configuration from ant to a gradle Configuration (similar to how configurations.antJwsc is done)

         classpath {
            pathelement(location: "${weblogicHome}/server/lib/weblogic.jar")
            pathelement(path: "${buildDir}/classes")
            fileset(dir: "${buildDir}/classes") {include name: "**/*.class"}
            pathelement(location: "${rootDir}/lib/commonlib/commonlib.jar")
            fileset(dir: "${rootDir}/lib/xml") {include name: "*.jar"}
            dirset(dir: "${rootDir}/services/xml") {include name: "*"}
         }