H
Herb
I'm trying to create a webservice that will return a table of items to the
caller. This seems like a pretty basic concept but since I am new to
Webservices it's turning out to be a task.
Here is what I want the XML file to look like:
<Media>
<title>Moonrock</title>
<stream>mms://...</stream>
<title>Earthrock</title>
<stream>mms://...</stream>
</Media>
Here is the code from my .NET 2.0 project:
<System.Web.Services.WebService(Namespace:="http://xxx.com/")> _
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<ToolboxItem(False)> _
Public Class AVService
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function ReturnVideoList() As Stream
Dim xmlStream As New MemoryStream
Dim writer As New XmlTextWriter(xmlStream, Encoding.UTF8)
writer.Formatting = Formatting.Indented
writer.WriteStartElement("Media")
writer.WriteElementString("Title", "California")
writer.WriteElementString("Stream",
"mms://www.themediapreserveav.com/videos/California.wmv")
writer.WriteEndElement()
writer.WriteFullEndElement()
writer.Flush()
xmlStream.Flush()
xmlStream.Position = 0
ReturnVideoList = xmlStream
End Function
When I test this code and click on the ReturnVideoList hyperlink that
displays, then click the Invoke button I get an HTTP 500 Internal Server
error.
Can someone please point me in the right direction toaccomplish this goal.
Thanks, Herb
caller. This seems like a pretty basic concept but since I am new to
Webservices it's turning out to be a task.
Here is what I want the XML file to look like:
<Media>
<title>Moonrock</title>
<stream>mms://...</stream>
<title>Earthrock</title>
<stream>mms://...</stream>
</Media>
Here is the code from my .NET 2.0 project:
<System.Web.Services.WebService(Namespace:="http://xxx.com/")> _
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<ToolboxItem(False)> _
Public Class AVService
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function ReturnVideoList() As Stream
Dim xmlStream As New MemoryStream
Dim writer As New XmlTextWriter(xmlStream, Encoding.UTF8)
writer.Formatting = Formatting.Indented
writer.WriteStartElement("Media")
writer.WriteElementString("Title", "California")
writer.WriteElementString("Stream",
"mms://www.themediapreserveav.com/videos/California.wmv")
writer.WriteEndElement()
writer.WriteFullEndElement()
writer.Flush()
xmlStream.Flush()
xmlStream.Position = 0
ReturnVideoList = xmlStream
End Function
When I test this code and click on the ReturnVideoList hyperlink that
displays, then click the Invoke button I get an HTTP 500 Internal Server
error.
Can someone please point me in the right direction toaccomplish this goal.
Thanks, Herb