Here's a quick how-to I put together to help those who want to access this beautiful work at lyricwiki.org via Java & Axis.
Using Axis to build the stubsEdit
- Download WSDL from here. For the purpose of this document I named this file lyricwiki.wsdl.
- Edit lyricwiki.wsdl according to JAVA && AXIS on this page.
- Download Axis from here (to write this document I downloaded axis-bin-1_4.tar.gz).
- Uncompress axis-bin_4.tar.gz (tar -zxvf axis-bin-1_4.tar.gz). This creates a directory named axis-1_4.
- Copy lyricwiki.wsdl to axis-1_4 directory and cd to that directory.
- You may now use a command like the following (all in one line) to build the stubs, skeletons, and data types from lyricwiki.wsdl.
java -cp lib:lib/axis-ant.jar:lib/axis.jar:lib/commons-discovery-0.2.jar:lib/commons-logging-1.0.4.jar: lib/log4j.properties:lib/saaj.jar:lib/wsdl4j-1.5.1.jar:lib/jaxrpc.jar org.apache.axis.wsdl.WSDL2Java lyricwiki.wsdl
- There should now be a directory named LyricWiki_pkg where the stubs are generated.
- You may now use the generated code with the following code snippet to pull in song lyrics.
LyricWikiLocator service = new LyricWikiLocator(); LyricWikiPortType port = service.getLyricWikiPort(); LyricsResult lyrics = port.getSong("artist", "song title"); System.out.println("Lyrics:\n\n"+lyrics.getLyrics());
- Please note that obfuscating Java code which has been generated by Apache Axis 1.4 (It does not matter how) results in various exceptions during the runtime.
I hope you find the above instructions helpful.
Kjavaher 03:56, 10 January 2008 (EST) - Kamran Javaheri
Last edit regarding code obfuscation by --Schokomuesli 22:39, March 10, 2010 (UTC)