Search

WCF Service Opertation : Unable to return collection of type Enumerbale<string> by c_roots

Active

8
0
Sign in
to vote
Type: Bug
ID: 767210
Opened: 10/12/2012 9:33:39 AM
Access Restriction: Public
0
Workaround(s)
3
User(s) can reproduce this bug
Experiencing the same issue as reported here

http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataservices/thread/fff6ab98-7308-4b68-b1f3-6d69dc95c940

when trying to access results from a service operation,
[WebGet]
        public IEnumerable<string> GetSuppliersForCommonReference(int commonReference)
        {
            ......
         }

when unit testing recieve exception with message,

Exception message,
An XML node of type 'Element' was found in a string value. An element with a string value can only contain Text, CDATA, SignificantWhitespace, Whitespace or Comment nodes.

tried creating testmethod in web service as per example here,
http://msdn.microsoft.com/en-us/library/hh230677.aspx

same result occurs


Details (expand)

Visual Studio/Team Foundation Server/.NET Framework Tooling Version

.NET Framework 4.5

Steps to reproduce

Build service host
Build domain server project
Run relavent unit tests

run unit test with

string results = _persistenceSession.GetSuppliersForCommonReference.ExecuteEnumerable()

Product Language

English

Operating System

Windows 7

Operating System Language

English

Actual results

Test method

Davies.Complaints.Test.UnitTests.ComplaintDomainClientUnitTest.DClient_GetSuppliersForCommonRef threw exception: System.InvalidOperationException: An XML node of type 'Element' was found in a string value. An element with a string value can only contain Text, CDATA, SignificantWhitespace, Whitespace or Comment nodes. ---> Microsoft.Data.OData.ODataException: An XML node of type 'Element' was found in a string value. An element with a string value can only contain Text, CDATA, SignificantWhitespace, Whitespace or Comment nodes.

Expected results

return of list <sting> with count = 2
containing data from service from
as per,

<?xml version="1.0" encoding="UTF-8"?>
-<GetSuppliersForCommonReference xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><element>ChemDry UK Limited</element><element>Eastwell Contractor Management</element></GetSuppliersForCommonReference>
File Attachments
File Name Submitted By Submitted On File Size  
TestProject.zip 3/11/2013 13.25 MB
Sign in to post a comment.
Posted by Microsoft on 10/12/2012 at 9:50 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.