Currently, the way our app works is we download a text file that describes the information we want. Then we use NSURLConnection and request that one packet that the text file describes. Then we ask for the next packet, wait for it to come in, check it, then ask for the next packet.
Is there a better way to do this without the text file? I feel like I should be able to have the app say, "InformationForJohnDoe" and then the server will just start sending all the packets for JohnDoe, but in this scenario, I don't know how I'd know which data is which in my connectionDidFinishLoading delegate method.
The web service implementation looks like this:
[WebGet(UriTemplate = "GetTestData/{file}")]
public Stream GetTestData(string file)
{
string fileName =
"\\testdirectory" + file;
if (File.Exists(fileName))
{
FileStream stream = File.OpenRead(fileName);
if (WebOperationContext.Current != null)
{
WebOperationContext.Current.OutgoingResponse.ContentType = "text/.txt";
}
return stream;
}
return null;
}
I'm not much of a C# person. I've only just started in C# and web services.