Grid not finding Schema in WebService

Denaes

Senior Contributor
Joined
Jun 10, 2003
Messages
956
If I have a Stored Procedure and use the SqlDataSource to connect to it, my grid (MS or Infragistics) picks up the schema no problem and gives all the columns a basic formatting with what it believes the schema is intending. Not always perfect, but it's a starting point.

Now I take the same Stored Procedure and access it through a WebService or an SQLServer Endpoint (turns a stored procedure into a web service call) and I add the WebReference to my project. Everything is looking fine and when I view the ASMX file (for the WebService) I get a list of methods and when I Invoke one, I see a schema prior to the returned information.

But I connect an ObjectDataSource to a WebMethod on the WebService and connect a grid to the ObjectDataSource I get nothing. Just a blank grid. It's not showing the schema at all.

All the examples I find of a GridView consuming a WebService shows it being bound in code, which doesn't allow you any designtime support and the GridView then displays all columns with default types and column names.

How do you actually consume a Web Service correctly so that it conveys the schema?
 
Back
Top