Skip to content

Instantly share code, notes, and snippets.

@minhajkk
Created July 8, 2012 15:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save minhajkk/3071328 to your computer and use it in GitHub Desktop.
Save minhajkk/3071328 to your computer and use it in GitHub Desktop.
gant script for generating stubs from a whizdul file...
import grails.util.GrailsUtil
includeTargets << grailsScript("Init")
target(main: "The description of the script goes here!") {
File whizdul = new File("${basedir}/grails-app/conf/enterprise.wsdl")
if (whizdul.exists()) {
String[] attrs = [
"${basedir}/grails-app/conf/enterprise.wsdl",
"-d",
"${basedir}/src/java/",
"-B-XautoNameResolution",
"-wsdllocation",
"${basedir}/grails-app/conf/enterprise.wsdl",
"-keep",
"-Xnocompile"
]
//Returns: 0 if the tool runs successfully.
//For more info check: http://www.jarvana.com/jarvana/view/com/sun/xml/ws/jaxws-tools/2.2.6-promoted-b02/jaxws-tools-2.2.6-promoted-b02-javadoc.jar!/com/sun/tools/ws/WsImport.html#doMain(java.lang.String[])
def isStubGenerated = com.sun.tools.ws.WsImport.doMain(attrs)
if(isStubGenerated == 0){
println "Salesforce enterprise.wsdl stubs have been generated successfully."
}
} else {
print "ERROR: "
println "Salesforce enterprise whizdul does not exist."
println "Please goto salesforce.com download enetrprise whizdul and copy it inside /web-app/WEB-INF/wsdl/ of project."
}
}
setDefaultTarget(main)
@hussainanjar
Copy link

Thanks for sharing :)

@minhajkk
Copy link
Author

minhajkk commented Jul 9, 2012

Always a pleasure :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment