Error processing response stream. The XML element contains mixed content
I'm calling a stored procedure via WCf-DataService and EF4. Other method works fine but one which return List failed with the exception Error processing response stream. The XML element contains mixed content.
Here is the XML return by the method (call in http)
<GetShowName>
<element>MONT</element>
<element>INTERPEECH 08/2011</element>
<element>POI MOBILIER 09/2011</element>
<element>ASSEMBLE GALE CLUB 41 06/2011</element>
<element>AFTES 10/2011</element>
<element>DIVERS DEVIS 12/2011</element>
<element>DIVERS DEVIS 12/2011</element>
<element>SFTS 2011</element>
<element>COUPE DU MONDE BIATHLON 12/11</element>
<element>CADRE NOIR GENEVE 04/20开发者_JS百科11</element>
</GetShowName>
And the code is:
private List<T> ListWithFilter<T>(string methodName, string methodParameters)
{
StringBuilder methodParams = new StringBuilder("/" + methodName + "?");
methodParams.Append(methodParameters);
Uri methodUri = new Uri(entities.BaseUri + methodParams.ToString());
List<T> result = entities.Execute<T>(methodUri).ToList(); //Exception here
return result;
}
Any idea?
According to this post the client does not support primitive type materialization as of .NET 4.0. May need to parse the result manually:
Invoking a WebGet throws an exception
精彩评论