how can display a string from a rest webservice in windows forms my xml looks like this:
<string>whatever</string>
How can you display that in a textbox in win forms?
If I try
string uri = string.Format("etc/{0}/{1} Sad.Text, Happy.Text");
XDocument xDoc = XDocument.Load(uri);
string mystring = xDoc.Element("String").Value;
textBox1.Text = mystring;
You get an object reference error?
XML elements are case-sensitive. Try,
A better way to solve the problem is to not use XML to return a simple string. The media type
text/plainis designed to do that. If you are using Microsoft’s ASP.NET Web API just returnand on the client (using this http://nuget.org/Packages/system.net.http) do,