简体   繁体   English

RESTfull搜索服务问题

[英]A RESTfull search service Question

I have a SQL Server (2008) database that contains address details that i want to make available to search as a rest service. 我有一个SQL Server(2008)数据库,其中包含我想提供的地址详细信息,以作为休息服务进行搜索。

All that needs to be available is the ability to pass an address or part of an address and the service will return the potential candidates, much like yahoo or googles rest services. 需要提供的只是传递地址或地址一部分的能力,该服务将返回潜在的候选人,就像yahoo或googles rest服务一样。

My question is, from a high level what is the best approach to take for this? 我的问题是,从较高的角度来看,最好的方法是什么? I am using .net 4 and VS2010 but i have never made a rest service before. 我正在使用.net 4和VS2010,但之前从未做过休息服务。

Any links to similar articles or advice on the best approach would be appreciated 任何链接到类似文章或有关最佳方法的建议,将不胜感激

I've included a link to a very basic tutorial on making your own restful web service. 我提供了一个非常基本的教程的链接,该教程介绍了如何制作自己的静态Web服务。 Publishing web services aren't that difficult especially when no authentication is involved. 发布Web服务并不那么困难,尤其是在不涉及身份验证的情况下。 Essentially you need to define a new class that inherits IHttpHandler interface, implement a couple of methods including the ProcessRequest inside which you can write text into the Response object. 本质上,您需要定义一个继承IHttpHandler接口的新类,实现一些方法,包括ProcessRequest ,您可以在其中将文本写入Response对象。 You may have to look into the Request object for query parameters (if you need to) and query your db accordingly. 您可能需要查看Request对象的查询参数(如果需要),并相应地查询数据库。

http://www.codeproject.com/KB/aspnet/RestServicesInASPNET2.aspx http://www.codeproject.com/KB/aspnet/RestServicesInASPNET2.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM