I’m actually playing around with the last.FM web serivce API which I call via REST. When I get the response I try to convert the result into a XDocument so I could use LINQ to work with it.
But when I pass the result string to the XDocumnet constructor an ArgumentException is thrown telling me that ‘Non white space characters cannot be added to content.’. Unfortunately I’m very new to web services and XML programming so I don’t really know how to interpret this exception.
I hope someone could give me a hint how to solve this problem.
It sounds to me as though you are holding the response in a string. If that is the case, you can try to use the Parse method on XDocument which is for parsing XML out of a string.
This may or may not solve your problem. Just a suggestion that is worth a try to see if you get a different result.