L
Lloyd Sheen
I generated the stubs for a web service that provides lyric information for
songs.
The URL of the wsdl is:
http://lyricwiki.org/server.php?wsdl
Some of the calls work with no problem but there are several which I have a
problem with:
The one I will use to illustrate the problem is a getArtist call. The
generated stub has a signature of :
Public Function getArtist(ByRef artist As String) As String()
Member of SongLyrics.org.lyricwiki.LyricWiki
The code I am using to get the error is:
Try
result = songSearch.getArtist(artist)
Catch ex As Exception
End Try
The message in the exception is:
{"There is an error in XML document (1, 533)."}
System.InvalidOperationException: {"There is an error in XML document
(1, 533)."}
Data: {System.Collections.ListDictionaryInternal}
HelpLink: Nothing
InnerException: {"Cannot assign object of type System.String to an
object of type System.String[]."}
Message: "There is an error in XML document (1, 533)."
Source: "System.Xml"
StackTrace: " at
System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader,
String encodingStyle, XmlDeserializationEvents events) at
System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader,
String encodingStyle) at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters) at
SongLyrics.org.lyricwiki.LyricWiki.getArtist(String& artist) in C:\Visual
Studio Projects\Brand New Music Console\SongLyrics\Web
References\org.lyricwiki\Reference.vb:line 334 at
New_Music_Console.SongViewUC.GetSongLyricsToolStripMenuItem_Click(Object
sender, EventArgs e) in C:\Visual Studio Projects\Brand New Music
Console\New Music Console\UserControls\SongViewUC.vb:line 1809"
TargetSite: {System.Reflection.RuntimeMethodInfo}
I have also captured the call thru Fiddler (what a great tool except that
the XML view does not have a copy).
Sent information:
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="urn:LyricWiki" xmlns:types="urn:LyricWiki/encodedTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><tns:getArtist><artist
xsi:type="xsd:string">Amanda
Somerville</artist></tns:getArtist></soap:Body></soap:Envelope>
Recieved information:
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:si="http://soapinterop.org/xsd"
xmlns:tns="urn:LyricWiki"><SOAP-ENV:Body><ns1:getArtistResponse
xmlns:ns1="urn:LyricWiki"><artist xsi:type="xsd:string">Amanda
Somerville</artist><albums xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="tns:AlbumData[0]"></albums></ns1:getArtistResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
I don't know much about SOAP and rely on the generated code but I hope
someone can lead me to a cause. Even if the information is sent incorrectly
or recieved incorrectly I could get a hold of the people who are responsible
for the API and let them know.
Thanks
Lloyd Sheen
songs.
The URL of the wsdl is:
http://lyricwiki.org/server.php?wsdl
Some of the calls work with no problem but there are several which I have a
problem with:
The one I will use to illustrate the problem is a getArtist call. The
generated stub has a signature of :
Public Function getArtist(ByRef artist As String) As String()
Member of SongLyrics.org.lyricwiki.LyricWiki
The code I am using to get the error is:
Try
result = songSearch.getArtist(artist)
Catch ex As Exception
End Try
The message in the exception is:
{"There is an error in XML document (1, 533)."}
System.InvalidOperationException: {"There is an error in XML document
(1, 533)."}
Data: {System.Collections.ListDictionaryInternal}
HelpLink: Nothing
InnerException: {"Cannot assign object of type System.String to an
object of type System.String[]."}
Message: "There is an error in XML document (1, 533)."
Source: "System.Xml"
StackTrace: " at
System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader,
String encodingStyle, XmlDeserializationEvents events) at
System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader,
String encodingStyle) at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters) at
SongLyrics.org.lyricwiki.LyricWiki.getArtist(String& artist) in C:\Visual
Studio Projects\Brand New Music Console\SongLyrics\Web
References\org.lyricwiki\Reference.vb:line 334 at
New_Music_Console.SongViewUC.GetSongLyricsToolStripMenuItem_Click(Object
sender, EventArgs e) in C:\Visual Studio Projects\Brand New Music
Console\New Music Console\UserControls\SongViewUC.vb:line 1809"
TargetSite: {System.Reflection.RuntimeMethodInfo}
I have also captured the call thru Fiddler (what a great tool except that
the XML view does not have a copy).
Sent information:
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="urn:LyricWiki" xmlns:types="urn:LyricWiki/encodedTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><tns:getArtist><artist
xsi:type="xsd:string">Amanda
Somerville</artist></tns:getArtist></soap:Body></soap:Envelope>
Recieved information:
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:si="http://soapinterop.org/xsd"
xmlns:tns="urn:LyricWiki"><SOAP-ENV:Body><ns1:getArtistResponse
xmlns:ns1="urn:LyricWiki"><artist xsi:type="xsd:string">Amanda
Somerville</artist><albums xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="tns:AlbumData[0]"></albums></ns1:getArtistResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
I don't know much about SOAP and rely on the generated code but I hope
someone can lead me to a cause. Even if the information is sent incorrectly
or recieved incorrectly I could get a hold of the people who are responsible
for the API and let them know.
Thanks
Lloyd Sheen