Webrequest.GetResponse error - no end of entity mark

S

SteveG

Anybody know what could cause the error "The response did not contain an
end of entity mark" in the Webrequest.Getresponse method?

Here's some background: I'm writing a Pocket PC app in Visual Basic
that communicates with the Turtle Beach Audiotron, a hardware digital
music server that can be controlled over the network via a built-in web
server. Turtle Beach published a programming API for the Audiotron;
commands are sent as HTTP GET requests. E.g., you tell the audiotron to
advance to the next track by sending the URL
"http://192.168.0.103/apicmd.asp?cmd=next", where 192.168.0.103 is the
network address of the audiotron. The Audiotron API also states that
replies from the GET are returned as plain text data (MIME type is
"text/Plain"). In the case of a successful "next track" command as
described above, the response would be "Error 0 - Success/n".

Ok, so here's my code that sends a "skip to the next track" command to
the audiotron. It works fine in my PC-based version of the app, but
the GetResponse method gives the aforementioned "The response did not
contain an end of entity mark" error when executed in the .NET compact
framework and deployed to the PocketPC emulator.

Dim sResponse, rspText
Dim req As HttpWebRequest
Dim rsp As WebResponse
Dim rspStream As Stream
Dim creds As New NetworkCredential(userID, password)
Dim sURL As New Uri("http://192.168.0.103/apicmd.asp?cmd=next")

req = WebRequest.Create(sURL)
req.Credentials = creds
req.Method = "GET"

rsp = req.GetResponse()
rspStream = rsp.GetResponseStream
Dim readStream As New StreamReader(rspStream, Encoding.UTF8)
rspText = readStream.ReadToEnd()
rsp.Close()

I can't find any documentation for the error (usenet searches, MSDN,
websearches, etc.). I have confirmed that it is not an emulator
communication problem, as the code works for external URLs (such as
www.google.com) and for another webserver inside my network (my
router's built-in webserver). Also, If I put in an invalid URL, I get
a completely different error. So the error is received only when
communicating with the Audiotron's built-in webserver, and even then
only in the .NET CF. I would love to hear any ideas!

Thanks :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top