views:

33

answers:

1

Hello,

I have a single WebMethod which will return List object as shown below

[WebMethod]
        public List<ContactMaster> GetContacts()
        {
            //ContactMaster contact = new ContactMaster();

            List<ContactMaster> contacts=new List<ContactMaster>();


            IQueryable<ContactMaster> contact = from c in db.ContactMasters
                                    select c;

            foreach (ContactMaster c in contact)
            {
                contacts.Add(c);

            }

            return  contacts ;
        }

When I try to invoke the same method from client I am getting an error as follows

System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.InvalidOperationException: There was an error generating the XML document. ---> System.InvalidOperationException
A: 

MSDN has an article for troubleshooting xml serialization issues. There's too much info to post here. I'd start at their article here.

However, step 1 should be to try to get to the Inner Exception, which should be more specific.

David Stratton