how to query SQL Server via REST to get XML

前端 未结 3 989
离开以前
离开以前 2020-12-30 08:48

We have been using a web application framework to build apps that need to be able to query a SQL Server database and get the results as XML.

In the past, the framewo

3条回答
  •  太阳男子
    2020-12-30 09:07

    Read here: Creating an OData API for StackOverflow including XML and JSON in 30 minutes. Basically, the road forward is for REST to be offered by app layer (WCF powering EF that provides the OData mapping). IMHO straight HTTP access into the engine was a very bad idea to start with, nobody liked the HTTPEndpoints of SQL Server 2005 and they were as misguided as it gets. One cannot map the HTTP error model, security, type system into SQL and expect a smooth interoperability. Having the HTTP layer live in a dedicated app pushes the responsibility of handling the HTTP ecosystem into a component specialized in that (WCF), and the logic of mapping the REST model to the DB model ina component specialized in that job (EF).

提交回复
热议问题