FANDOM

2,054,160 Pages

Replacement filing cabinet This page is an archive of past discussions. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current LyricWiki talk page.
LyricWiki talk archive for SOAP
<< 2008 2009  

Another Non-ASCII characters problem? SOAP and Visual Basic 2005 / .NET 2.0

Hi guys, I am using Visual Basic 2005 / .NET 2.0 to retrieve lyrics via SOAP. I am using as "web reference" the URL "http://lyricwiki.org/server.php?wsdl" and let Visual Basic do all the handling/decoding/parsing and retrieval of lyrics. In the end I get the lyrics as a string.

For some lyrics I retrieve results with wrong characters. Some examples are German Umlauts ("ä", "ö", "ü") as well as apostrophes " ' ". For example the lyrics from the song “Run” from the band “Extreme” are not retrieved correctly (http://lyricwiki.org/Extreme:Run, line 3: “Hey, so you got to go, you’re leaving what a pity”). This has something to do with the encoding of the lyrics. ISO8859 and UTF8 encoding are mixed up somehow.

The solution is the following: If I convert the lyrics (type string) to bytes assuming they are IS8859 encoded and convert the bytes back to string assuming they are UTF8 encoded it works fine: All characters are correct.

For clarification (and anybody who might be interested in it) I have included the source code:

Module modMain
    Public Function Get_Lyrics_from_LyricWiki(ByVal Artist As String, ByVal SongTitle As String) As String
        Dim objLyrics As New org.lyricwiki.LyricWiki
        Dim LyricsResult As org.lyricwiki.LyricsResult
        Try
            If objLyrics.checkSongExists(Artist, SongTitle) Then
                LyricsResult = objLyrics.getSong(Artist, SongTitle)
                With LyricsResult
                    If .lyrics = "Not found" Then
                        Return "Not found"
                    Else
                        Return ISO8859_to_UTF8(.lyrics)
                    End If
                End With
            Else
                Return "Not found"
            End If
        Catch ex As Exception
            Return "Not found"
        End Try
    End Function

    Public Function ISO8859_to_UTF8(ByVal Text As String) As String
        Dim UTF8Endcoding As New System.Text.UTF8Encoding
        Dim iso8859 As System.Text.Encoding = System.Text.Encoding.GetEncoding("ISO-8859-1")
        Return UTF8Endcoding.GetString(iso8859.GetBytes(Text))
    End Function
End Module

So is it a bug of a flawed Visual Basic implentation or (= something only I experienced so far - due to my lack of knowledge). Or is the cause for it somewhere else?

Hopefully my comment will help others not to repeat this problem (or solve it faster ;) ).— The preceding unsigned comment was added by CorranX (talkcontribs), 22:26, 24 February 2009.

Try the problem page again, is it fixed now? ∃cho⚡ierr∀ () 01:44, 25 February 2009 (UTC)
Yes, it does work for this page (http://lyricwiki.org/Extreme) and other lyrics from songs of that album also containing apostrophes " ' ". It does not work for other pages (i.e. containing Umlauts like http://lyricwiki.org/Die_Ärzte:Wie_Es_Geht). Thank you.
- CorranX - 15:22, 25 February 2009 (CET)
I think the problem with accents is on your side, as I can't reproduce it here... sorry ∃cho⚡ierr∀ () 12:32, 26 February 2009 (UTC)
Okay. Thanks for the effort. CorranX - 22:41, 5 March 2009 (CET)

Soap postSong trouble: "502 bad gateway" error

I'm having problems getting the postSong SOAP request to work with the php5 built in soap library.

$wsdl = "http://lyricwiki.org/server.php?wsdl";
$client = new SoapClient($wsdl);	
$onAlbums = array();
$onAlbums[] = array('artist'=>'', 'album'=>$row->album, 'year' => $row->release_date); 
$response = $client->postSong(false, $row->artist, $row->song, $row->lyrics, $onAlbums);

The row object is working as intended and the request fails with 502 bad gateway. Is this function working? Am I just missing something? I use the built in SOAP to retrieve songs all the time so I know it must be working. --Unravelthemusic 18:14, 5 March 2009 (UTC)

I am getting an "502 bad gateway" error message for about 2-3 days now everytime I am using either a home grown VB application (using "checkSongExists") as well as using "iLyrics". Both programs have been working fine before. Does anybody know what has happened? -- CorranX 22:48, 5 March 2009 (UTC)
I'm having the same issue when I try and call "checkSongExists" jdchitt 23:15, 5 March 2009 (UTC)
Thanks for reporting this, guys. I'm pretty sure I've fixed it now. Let me know if you see anything like this again.
Thanks,
-Sean Colombo (talk|contribs) 07:18, 6 March 2009 (UTC)
Works fine again. Thanks! -- CorranX 20:20, 7 March 2009 (UTC)

Problem with "+" in pagenames

Hello, Yesterday I've added the text http://lyricwiki.org/Jovanotti:Voglio_Di_+ , but when I try to request it using SOAP call, this returns "Not found"! Why this happens?

Thank you! User:LyrLover

Try now, renamed to Voglio Di '''Plus'''. API is incompatible with char "+" in pagenames (it's treated in url as conjunction).
And one more note: most of songs in this artist page need to be renamed according our Naming Policy (caps)... Hth, --Senvaikis (talk) 15:18, 3 March 2009 (UTC)
Thanks, Senv… SOAP is a book with seven seals to me. Question though: would a redirect from "…Plus" to "…+" work as well? Because the latter seems to be the correct song title, and should therefore also be the pagename. — 6x9 (Talk) 15:41, 3 March 2009 (UTC)
In fact, the correct song title is "Voglio Di +"! Now the SOAP call returns me an error in the parameters (song, artist) sent to the server.If I try http://lyricwiki.org/api.php?func=getSongResult&artist=Jovanotti&song=Voglio_Di_+&fmt=text the search returns a blank space! User:LyrLover
I moved it back to its correct title. If you replace the "+" in the above link with "Plus" it still works, but now (after the move) the accented characters are replaced with rubbish, whereas before they displayed completely.
"+" in pagenames has been allowed since the last MW upgrade, which was back in autumn, so I think this problem should be generally addressed. — 6x9 (Talk) 16:23, 3 March 2009 (UTC)
Ok! I'm sorry!
I've checked http://lyricwiki.org/api.php?func=getSongResult&artist=Jovanotti&song=Voglio_Di_Plus&fmt=text and http://lyricwiki.org/api.php?func=getSong&artist=Jovanotti&song=Voglio_Di_Plus&fmt=text but the result is the same! The lyrics doesn't appears!
The problem take place also with http://lyricwiki.org/api.php?func=getSongResult&artist=Pink&song=U_Plus_Ur_Hand&fmt=text
User:LyrLover
 :)... Sad to say, but if you really want the song to be API-accessible, it should be moved once more - back to Voglio Di '''Plus'''. Yes, 6x9's right - after MW upgrade "+" is allowed in LW pagenames and doesn't cause any problems for those, who are browsing the site... But not for API users. (Who told you that this upgrade has had any influence on API?). Moreover - API still fails working with redirects. So, if song name contains "+", API will not find it, 'cause it contains "+". If you make a page without "+" and redirected to this song, - API will not find it again, 'cause it's redirected to "+". The only one solution making such song available for both API & browser is solution I provided you in my last post (it was tested on API and did work) - placing all song information on the page with name without "+". If pagename corresponding to the original song name is very important for you, you may make a page with such original name and redirect it to the page with info. And if you say you don't like that - I'll agree, - I don't like that too. I'm just trying to show you some compromise way of making your songs available for all, while we have such API as we still have... This time I'll not make any changes, leaving it up to you ;) Good luck, --Senvaikis (talk) 20:52, 3 March 2009 (UTC)
P.S. For those who are more familiar with http requests: don't waste your time trying UrlEncoding ("+" -> "%2b") - it doesn't help here :(
Ok! Thanks! I've moved "Voglio di +" to "Voglio Di" and now the SOAP call works!!!
~LyrLover~
Please do not move/redirect these songs that included the symbol +. (At least not until Sean chimes in.) The old version of MediaWiki didn't allow the symbol, and so the SOAP, I'm guessing, matched that. Now the latest MediaWiki versions allow the symbol, the situation needs to be updated. No sense in going backwards with the pagenaming limitations. At least not until Sean says that the SOAP cannot be updated to fix this situation. (Also, in case the situation isn't ever allowed (and therefore LyricWiki:Page Names is updated), then whatever the + symbol is representing should be what is spelled out as a replacement. So U + Ur Hand should be U And Ur Hand, etc.)    Kiefer    talk    contribs    admin   12:30, 6 March 2009 (UTC)
Let's clarify situation: page of a song, containing "+" in it's title, may be represented on LW in two ways - as a page with original name (let's call it Page_+), or as a page with "+" replaced by "Plus" or "And" (Page_Plus). Both cases may have pages with an alternative title, redirected to the page with info. So, in the first case we'd have a redirection Page_Plus->Page_+, in the second one - Page_+->Page_Plus. Though LyricWiki:Page Names recommends first approach, I don't think that the second approach is a big crime, 'cause in both cases song lyrics can be successully accessed browsing LW site using any of mentioned titles. Now look at the same situation from the Api user point of view. Let's take last edition on Pink:U Plus Ur Hand - moving it to Pink:U + Ur Hand made this song absolutelly unavailable for API users under either name (as I tried to explain in previous post). So, is some NP statement (recomendational, not mandatory type) more important than information accessibility for all kinds of LW users? You may say that API should be changed, not the naming policy. Yes, agree. But why API users shoud be discriminated while it's not done? What's bad in using second approach for a while and just togging redirection after API revamping? Regards,--Senvaikis (talk) 13:41, 7 March 2009 (UTC)
Wowza! That was sticky, huh? Thanks for thinking through that one guys. I do agree that since the site itself has removed a restriction, it's better to just embrace that & change the API to work with it. I've fixed the API to allow + signs now. You can see it working here: U + Ur Hand. (For the record, we cache API results for up to 2 hours, so if you want to experiment on other pages right away, add something to the end of the URL (like "&cachebust123" or any other random string after the "&") to get around the caching.)
Thanks again for thinking through this one & thanks to User:Kiefer for bringing this thread to my attention. If there are any problems, please let me know.
-Sean Colombo (talk|contribs) 04:13, 9 March 2009 (UTC)

Uh-oh. SOAP accepting "+" now means that a lot of queries which previously worked (because "+" was converted to spaces) now show up as failures. (Brace yourself, that page doesn't look pretty right now.) So maybe redirects are the best solution after all…? (Especially since we might get a fully functional DISPLAYTITLE in the not-too-distant future.) — 6x9 (Talk) 02:39, 10 March 2009 (UTC)

I checked now, and Special:Soapfailures no longer shows these errors. Does that mean that this problem is solved?
Spacejens 07:28, 1 April 2009 (UTC)

Artists in song names

There are a number of artists B. B. King and Lil John & the eastside boyz for example that have the artist name in the song field of the soap response. <songs xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[7]"><item xsi:type="xsd:string">Lil' Jon & The East Side Boyz:I Like Dem Girlz</item>

I am willing to edit these artists to correct the issue but I can't find anything wrong with them specifically.

--Unravelthemusic 21:05, 11 March 2009 (UTC)

Can you give a specific example of such a song? tia ∃cho⚡ierr∀ ( ) 21:17, 11 March 2009 (UTC)
I just did, do a SOAP request for Lil Jon & The East Side Boyz and the first song will return <songs xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[7]"><item xsi:type="xsd:string">Lil' Jon & The East Side Boyz:I Like Dem Girlz</item>
--140.192.246.235 21:41, 11 March 2009 (UTC)
works just like any other song I fetch... ∃cho⚡ierr∀ ( ) 22:00, 11 March 2009 (UTC)
	{
			artist:"Lil Jon & The East Side Boyz", 
			song:"I Like Dem Girlz", 
			|url|:"http://lyricwiki.org/Lil_Jon_%26_The_East_Side_Boyz:I_Like_Dem_Girlz", 
			lyrics:"(Repeat 2x's)
It's some hoes in this house
....
I'm talking about using getArtist. I use get artist a lot and this is not normal behavior. You did getSong which returns the correct results.
--67.176.150.15 02:52, 12 March 2009 (UTC)
Weird, getArtist works correctly called from AppleScript, but thru the api I get the duplicated artist name that you describe.
B.B. King works as expected eitherway. Maybe Sean can figure this out. (Also tried couple of other & artists and they work fine) ∃cho⚡ierr∀ ( ) 04:12, 12 March 2009 (UTC)
Examples to help me debug:
-Sean Colombo (talk|contribs) 16:39, 28 March 2009 (UTC)
AHHHH!!!! I get it now! The code in the SOAP server will show just the song name if the artist name for the song is the same as the artist name for the page. In the case of Lil Jon & The East Side Boyz, the page is named as I just typed it, but many of the songs on the page are named with the artist being "Lil' Jon"... instead of "Lil Jon" (note the apostrophe). This means that the API is working as we'd expect, but the page is inconsistent & we'll have to fix that. UPDATE: Fixed the page. API results are normal now.
Thanks for reporting the problem,
-Sean Colombo (talk|contribs) 15:44, 24 April 2009 (UTC)

problem with wsdl

I can not get any result from your WSDL service. I check others programs and they did not work either. What is the problem? — The preceding unsigned comment was added by 93.86.215.38 (talkcontribs), 13:13, 9 March 2009.

I assume this problem is fixed, whatever it was? I don't have my SOAP application on this machine, so I can't check from here.
Spacejens 19:10, 5 April 2009 (UTC)

Can't figure out how to even get one song

All I know is I can do e.g.,

$ GET http://lyricwiki.org/index.php?title=Ice_Cube:What_They_Hittin%27_Foe%3F&action=raw

to get the raw lyrics of a song. How can I do the equivalent in this SOAP/Archive/2009 1 jazz? I don't understand all the documentation. All I want to know is what to HTTP GET. Jidanni 05:24, 22 March 2009 (UTC)

Try this cheers ∃cho⚡ierr∀ ( ) 06:18, 22 March 2009 (UTC)
Community content is available under Copyright unless otherwise noted.