May 01, 2012 05:02 AM|Steven Cheng - MSFT|LINK
The following exception message is indicating that you're trying to return some object which is not serializable by the service runtime:
"Cannot serialize member System.ComponentModel.Component.Site of type System.ComponentModel.ISite because it is an interface. "
and based on my test, if we simply return the string (by calling ToString on Connection object) in webservice webmethod, it should works correctly (here is the test webmethod I use):
public string GetConnectionString()
var sqlconn = new SqlConnection(@"data source=.\SQLExpress;initial catalog=Northwind;integrated security=True;");
Therefore, I'd suggest you recreating a webservice and define a similar webmethod to test it again. Also, you can verify if there is some other webmethods in your service which has directly return the SqlConnection object(that might cause the exception you