Recommendations for .NET Web Service Format/Protocol for Android, iPhone, etc. integration
I am building a web service for my ASP.NET MVC 3 website. Ideally I would like all clients (my web pages, iphone application, android application, windows phone 7 application, etc.) to use the same service layer to load and save data.
I am new to mobile development and was wondering if there is a preferred mechanism – SOAP/JSON/etc – to use a heterogeneous mobile device setup. Specifically I’m wondering if Android and iOS have better libraries/support for one protocol over another or if the main mobile platforms have strong support for all protocols. I am also wondering if all is even when it comes to securing said services.
Any advice would be much appreciated
- iOS - calling Webservice and parsing JSON in Swift
- How can I connect iPhone and web service and get XML data?
- Explanation of NSIncrementalStore in plain english
- How to POST data using AFNetworking 2.0?
- Calling JSON web service with parameters - Objective C - iOS
- how to get data which contains $ ` € and some Round Bullets using web service in Xcode
4 Solutions Collect From Internet About “Recommendations for .NET Web Service Format/Protocol for Android, iPhone, etc. integration”
I would suggest a REST(ful) service with JSON.
Both Android and iOS have libraries that support parsing XML and JSON, however the JSON libraries are a bit easier to use and are a little bit faster.
With a little more effort you could allow your service to provide/consume both XML and JSON.
It would be preferable to avoid SOAP as it is more verbose and not as suitable for the more bandwidth/battery sensitive mobile devices.
This would be a great opportunity for you to try out WCF Data services, together with Entity Framework. You can build it very fast, and it exposes your information model using the OData international standard in both XML and JSON flavor. The interface is accessible throught REST. No problems interacting with any front-end technology, fat, web or mobile clients.
AND, you have all the benefits of re-using your C# .NET knowledge, visual studio and created assemblies to also make more tighter integration with Windows applications if you need to. It certainly did the trick for me!
- Create your application model using Entity Framework. Either database first if you already have a physical datamodel, or model first is you are starting from scratch.
- Expose the created information model using WCF dataservices (5 lines of code)
You can find a walkthrough at: http://msdn.microsoft.com/en-us/magazine/ee336128.aspx
I have almost same situation and what am I doing is, I am making WCFrest services for android and iphone.
In terms of the security, I am using role based membership provider. So i have created a user for the mobile clients with the role of ‘Mobile clients’ and give the user id (guid) as an ‘api key’ to the android and iphone developer.
The iphone and android developer has to send the ‘api key’ in the header of the request.
so before executing any method in my wcf, i am checking the api key and also checking if the request is from an android or iphone device.
I hope this will help you a little to plan your development..:)
Try using ksoap2 and have your WCF services use the basicHTTP binding.
If you have only primitive types as parameters, this should very easy. With some work you can also use it for more complex types.
- Using enum types as properties in Objective C
- Firebase dynamic link doesnt work in safari swift
- event.touchesForView().AnyObject() not working in Xcode 6.3
- iOS – pushViewController vs presentModalViewController difference
- Adding Core Data to existing iPhone project
- layer.renderInContext doesn't take layer.mask into account?
- iOS UITableViewCells rows recycled and tag not working
- Using unowned inside of a capture list causing a crash even the block itself isn't executed
- iOS multitasking for an Audio Recording application
- NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802) on a subdomain?
- Why subclass NSObject?
- GSSendEvent – Inject Touch Event iOS
- Why is there a rough black edge when rounding corner of UIButton?
- Missing file warnings showing up after upgrade to XCode 4
- Escape Quotes in Objective-C