Saturday, April 18, 2009

How to generate a wsdl2 file using Axis2 java2wsdl

If you are not familiarized with WSDL 2.0 creating one of these files from scratch for your web service can be a daunting experience. Axis2 provides a java2wsdl tool that can make this task easier by automatically creating the file for you.

Download the latest version here and after decompressing the file, set a system variable pointing to the installation path by adding the following line to your Linux "/etc/profile" file:

export AXIS2_HOME="/opt/Programs/axis2-1.4.1"

The command line tool has the following options available:

-o output directory
-of output file name for the WSDL
-sn service name
-l address of the port for the WSDL
-cp list of classpath entries - (urls)
-tn target namespace for service
-tp target namespace prefix for service
-stn target namespace for schema
-stp target namespace prefix for schema
-st style for the WSDL
-u use for the WSDL
-nsg fully qualified name of a class that implements NamespaceGenerator
-sg fully qualified name of a class that implements SchemaGenerator
-p2n [,,] to assign all types to a single namespace
-efd setting for elementFormDefault (defaults to qualified)
-afd setting for attributeFormDefault (defaults to qualified)
-xc class1 -xc class2... extra class(es) for which schematype must be generated.
-wv <1.1/2.0> wsdl version - defaults to 1.1 if not specified
-dlb generate schemas conforming to doc/lit/bare style

Here is a sample of how to use the command to generate a WSDL 2.0 file for "MyService":

/axis2-1.4.1/bin/java2wsdl.sh -wv 2.0 -o /workspace/myApp/src/META-INF/ -of MyService.wsdl -sn MyService -cp:/workspace/myApp/target/classes -cn sample.package.MyService

Notice how the classpath is specified, each location is separated with a colon, in case you have multiple entries it with look like this:

-cp:/location1/classes:/location2/otherClasses

This command also has an Eclipse plugin but it doesn't generate files for the WSDL 2.0 version, in the mean time it can make your life easier, just bear in mind that in case you have a complex service it is possible that you will have to tweak the file a bit to make it work, but for a simple test it can work like a charm ;)

Friday, April 17, 2009

How to create a profitable business

Great presentation from David Heinemeier at Startup School 08 about how to create a profitable business without dying in the attempt:

&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;div&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;a href='http://www.omnisio.com'&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;Share and annotate your videos&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt; with Omnisio!&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;/div&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;

A few simple but useful Eclipse tips

Eclipse is the most popular Java IDE in use by developers, and there are many of them spending hours and hours in front of it everyday trying to solve issues, create new functionalities and such, here goes a couple of simple but very useful tips to make those hours more productive:
  • Use "Ctrl + Page Up / Down" to walk between opened editor tabs.
  • Try "Alt + Left / Right" to go backwards and forwards in your editing history.
  • Finnally use "Ctrl + F6" to cycle through opened files.
Hope this helps ;)

Saturday, April 4, 2009

KDE 4.2 updagrade & install

After installing KDE 4 a couple of months ago I wrote a post about how many flaws were released with that version, it took me a month or so to get used to the bugs that came with the upgrade, probably the worse one was that some tray icons, like the Wifi manager or Amarok, were not being docked at all and they were just behaving as a separate program.


Finally in April KDE officially released version 4.2.2, a more stable version including bug fixes and performance enhancement worth trying.


First step was to try the KDE upgrade instructions available on this site. After rebooting KDE wasn't working anymore and the only available option was Gnome, it took me a while to understand what went wrong but after checking a couple of forums and googling for a while I made it work by doing this:

-Using Synaptic, add "deb http://ppa.launchpad.net/kubuntu-experimental/ubuntu intrepid main" at the "Third-Party Software" list. Enable this one and disable all the others in the list.
-Go to the "Updates" tab and tick on the option "Unsupported updates (intrepid-backports)"
-Close the "Software Sources" panel and reload the packages list.
-Find and install "kubuntu-desktop" from the packages list.

After this you'll be able to follow the normal installation process and the KDE 4.2 desktop will be available after reboot.

Enjoy ;)