Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
REST web service
Message
From
17/12/2014 05:46:30
 
 
To
All
General information
Forum:
Internet
Category:
Other
Title:
REST web service
Miscellaneous
Thread ID:
01612361
Message ID:
01612361
Views:
56
Hi

I've got some code that accesses a REST web service to get authorisation and then get a token.

The line XDocument doc = XDocument.Load(stream);

returns an error

'doctype' is an unexpected token. The expected token is 'DOCTYPE'

How can I see the contents of the response stream and why would I get that error ?

Thanks


HttpWebResponse response = ProfileSampleApp.httpWrapper.getAccessToken(accessTokenURL);
string token = Utils.getElementValue("Token",response.GetResponseStream());

public static string getElementValue(string elementName,Stream stream)
{
XDocument doc = XDocument.Load(stream);
return (from element in doc.Descendants(elementName)
select element).Single().Value;
}
Next
Reply
Map
View

Click here to load this message in the networking platform