Mapping SQL Server Database Using REST

I just did some research on the Internet about how I can easily open a SQL Server database using REST, and it comes down to two different materials: WCF and WCF Data Service. I really want my database to display in REST. So what do you guys think is the easiest, fastest and most effective way to do this?

I know that using WCF data services I can provide data using the OData protocol, which is an atom. I really wanted to use this data on the iPhone. What then will I need to add this library to my iPhone. It seems that the CTP version of this library only reads, and I also want to write to the database.

+4
source share
1 answer

Without knowing what you want to do, I would say that the easiest and most efficient way would be to use WCF data services.

You do not need to include a library to use the OData feed of the WCF data service. The service simply returns XML or JSON based on what you specified in the Accepts header:

For XML (which is the standard format):

 Accepts: application/atom+xml 

For JSON:

 Accepts: application/json 

Your interaction with your WCF data service is through HTTP. The client libraries you are looking at just help you with these calls, but if you can program HTTP using Objective-C, you won’t need it.

In addition, WCF and OData data services support all CRUD operations using the HTTP verbs GET, POST, PUT, and DELETE (and MERGE, which is new to this protocol, I think). If in the iPhone app you can create HTTP requests using the POST, PUT, and DELETE commands, then your service will support this.

So, I would go with WCF data services. Just keep track of whether you are dealing with a raw result, that it can be quite detailed. If you can handle JSON in your iPhone application, I would go this way to reduce the size of the payload.

And I have to say that I'm not an iPhone developer, so I might miss something. Hope this helps and let me know if there are any other questions and I will update my answer accordingly.

Thanks.

+2
source

All Articles