Showing posts with label java. Show all posts
Showing posts with label java. Show all posts
Monday, April 28, 2014
Cxf wsdl2Java: using binding file to rename a complextype
Sometimes there is need to rename a complextype from the wsdl when you use wsdl2java. For example if you want the generated code to be put in a specific package (-p option) and you do not want to use the '-autoNameResolution' option. Then the external bindings file comes to the rescue! Here is the file I have used to rename "VatNumber_Exception" into "VatNumException"
Happy copying!
Saturday, February 16, 2013
Generate java from Wsdl with gradle
UPDATE: I have made a plugin to do this, just follow the guide on https://github.com/nilsmagnus/wsdl2java .
The plain simple way to generate java from wsdl is this: add a javaexec task to your wsdl and run. The following code snippet will help you out:
The plain simple way to generate java from wsdl is this: add a javaexec task to your wsdl and run. The following code snippet will help you out:
The "wsdlsToGenerate" contains all the arguments for the org.apache.cxf.tools.wsdlto.WsdlToJava class, in the right order.
However, if you have a project like I have with 58 different wsdls, this approach is very time consuming. This is because every time createJavaFromWsdl() is called, a new java process will be started, executed and stopped. Now you have 58 sequential java processes running in your build script(!).
Instead, why not run everything in the same java process? This can be done with code snippet 2:
Now, this adds some dependencies to the build-script, but I can live with that.
The runtime from snippet1 with 58 wsdls is 2min 58secons on my laptop. The runtime of snippet2 is 24seconds!
Labels:
buildscript,
cxf,
gradle,
java,
wsdl2java,
wsdltojava
Wednesday, October 19, 2011
Gradle remote debug for java
Type:
export GRADLE_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=y"
Run your gradle commands as normal and hook up on port 4000 to remote debug your app.
E.g. ./gradlew jettyRun
export GRADLE_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=y"
Run your gradle commands as normal and hook up on port 4000 to remote debug your app.
E.g. ./gradlew jettyRun
Subscribe to:
Posts (Atom)