Astoria Data Servers have an obvious comparison with custom written Web Services that include methods that return packets of XML data. In making the comparison people want to be sure that all of the boxes that are checked for web services are also checked for Astoria Data Services. One of these boxes is discoverability. Web Services expose WSDL so that clients can discover their methods, parameters and return results. Astoria Data Services expose some of this information in a ’root’ node of the service. For example:-
http://localhost:1234/Northwind.svc
This returns an XML packet listing all of the entities (tables, views, stored procedures etc.) exposed by the service. What it doesn’t expose, however, is custom methods. As custom methods might arguably be used more frequently this is rather important. The trick to discovering these methods is to know the undocumented (at the time of writing) switch, $sys_GetEdmSchema. For example:-
http://localhost:1234/Northwind.svc/$sys_GetEdmSchema
(Note that "$sys_GetEdmSchema" will change to "$metadata" or "$sys_metadata" in the release after the September 2007 CTP.)
The result is an EntityContainer element including a FunctionImport element:-
FunctionImport Name="CustomersByCountry"
This also includes a list of Parameter elements. Problem solved.
Technorati Tags:
Astoria
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5