|
SOAP - A XML based server side API (Version 2.1)
Updated 2002-10-14 |
||||||||||||||||||||||||
| How does SOAP work?
SOAP (Simple Object Access Protocol) is a very simple and easy implementable protocol written for the Lyrictracker project. The whole protocol is based on the HTTP protocol and uses the HTTP FORM and GET commands to exchange data with the database server. It is virtually possible to connect any application independently of the platform to search and get song lyrics from the database. Please note that the official SOAP definition in AppleScript has nothing to do with this. Well, not much at least. Since we are already working on support for chords, given changes will be made shortly to the protocol. Please note that the current given definition won't change but attributes may be added. What is the URL of the API? All requests of the clients go to the one script that handles requests and converts them to the XML before it returns the information to the client. http://lyrictracker.com/soap.php You may either use the POST command (recommed) or the GET command to send parameters to the server. To encode characters please use the ISO-8859-1 (Latin-1) encoding. Request Basics Here is a list of parameters that have to be included within every request your client makes to the server:
|
||||||||||||||||||||||||
|
Searching the database and receiving results
|
||||||||||||||||||||||||
|
To tell the server to query the database for given information you have to use the following RS (Request Specification). The XML returned by the server is described below.
Server Reply In the following example we searched with the following parameters: ar = "Janet Jackson" and ti = "gone". <?xml version="1.0"?>
<result id="Njk5" artist="Bryan Adams" title="Long Gone" album="" year="" views="" composer=""/> <result id="MTk3MA==" artist="Pennywise" title="Gone" album="" year="" views="" composer=""/> </xml> |
||||||||||||||||||||||||
|
Returning the lyric from the server
|
||||||||||||||||||||||||
To return the text of a lyric from the database server you have to call the API with th following parameters and you will receive the lyrictext directly in the HTTP response body.
Server Reply The server will reply the lyric's text or in case of an error, the string "ERROR 1". |
||||||||||||||||||||||||
|
Submitting song lyrics to the database
|
||||||||||||||||||||||||
In some cases you might want to let the users submit song lyrics to the database. For this purpose you have to use the following RS and submit the information to the server using a POST HTTP command.
Server Replies If everything goes right, the server will return a simple "OK" in the body of the response. If you get an "ERROR 1" the username or the password are incorrect and you have to ask the user to try again. |
||||||||||||||||||||||||
|
Receiving the MWL (Most Wanted Lyrics) list from the server
|
||||||||||||||||||||||||
The Lyrictracker database supports a system that lets users request lyrics. This system - called MWL - allows to notify users if a given lyric got added to the database. To fill a MWLreq (MWL Request) you have to add the id of the given WML entry to the submit method in the mwlid parameter (see above).
Server Reply <?xml version="1.0"?>
<mwl id="7" artist="Michael Jackson" title="Thriller" dots="244"/> <mwl id="8" artist="Smile.DK" title="Butterfly" dots="120"/> |