Common web service for asp.net, iPhone and Android - iphone

What are the necessary points that we should keep in mind while developing web service .NET that can be accessed by ASP.NET and mobile phones like iPhone and Android?

Web services by design are platform agnostic, which means that you should be able to access them from any application. However depending upon the relevant framework options available different implementations might be easier to access that others (XML/SOAP via .NET as an example).
Building a REST service serving up JSON could be your best option for an easy adoption on multiple platforms.
REST vs SOAP

Web Services
1.It Can be accessed only over HTTP
2.It works in stateless environment
WCF
WCF is flexible because its services can be hosted in different types of applications. The following lists several common scenarios for hosting WCF services:
IIS
WAS
Self-hosting
Managed Windows Service
For mobile application check http://www.c-sharpcorner.com/UploadFile/sry_143/4010/
For ASP.Net application check http://geekswithblogs.net/nestor/articles/108042.aspx
Happy coding!!

Related

Azure Service Fabric Template - Which one to choose

I am creating a service fabric application. I saw in the Microsoft documentation that, based on how we store the data we can choose between stateless and sate full template.
But under .net core 2.0 itself, it has "stateless" and "stateless Asp.net core". What is the difference between these two.
My requirement is to migrate a existing web api which is stateless. As per the microservice architecture, I have selected a Stateless Asp.Net core template as the front facing api and I am not able to decide the template for Web api.
Thanks in advance
it has "stateless" and "stateless Asp.net core". What is the
difference between these two.
Stateless Service is a simple template to build a basic reliable services.
Stateless ASP.NET Core is a more complete template to build a reliable service that uses ASP.NET Core. It is a great starting point for any website or web API.
My requirement is to migrate a existing web api which is stateless. As
per the microservice architecture, I have selected a Stateless Asp.Net
core template as the front facing api and I am not able to decide the
template for Web api.
Do chose Stateless ASP.NET Core because you will host a web API.

Using REST api to build a web app

What happens when we do not use REST api to build a web application? And also please tell how to build a web service using REST api in PHP.
What happens when we do not use REST api to build a web application?
Nothing, you can do your project with or without REST API. Assume you are running a restaurant and you want to attach with online food service like Foodpanda,zomato you need to provide an API to interact your data without any user interface which can be done easily using REST.
Why do we need RESTful web services?
REST should be used if it is very important for you to minimize the coupling between client and server components in a distributed application. [read more]
How to build a web service using REST api in PHP?
There are many resources available in internet. Here I found something related to PHP
PHP RESTful Web Service

Standalone ServiceStack service for Web & Native Mobile App

Our architecture consists of several backend (non-ServiceStack) services and applications that send data to our system via ServiceStack service hosted in asp.net - this is currently a standalone ServiceProject project containing our required Services/Repository/DTOs following the structure of all the provided ServiceStack samples.
With our backend complete we're now designing our two front-end requirements consisting of a web application and native mobile application. For the web application I'd really like to continue leveraging ServiceStack by using the Razor plugin to create the application's layout/views from our existing DTOs, for our mobile app we will only rely on the ServiceStack service for authentication and data - as it is native it's layout/views will come from it's own SDK.
Can I leave my standalone ServiceStack service as is and:
Create a separate web application project that authenticates
against our existing standalone ServiceStack service and uses the
Razor view plugin?
Have our native mobile app clients
authenticate against the same standalone ServiceStack service?
Most of the examples ie. RazorRockstars I've seen have the services embedded in the web project so I'm not sure if this distributed type of setup is supported. Any guidance or feedback on this is greatly appreciated!
It is very much possible. You can consume the web service from both, web and native mobile application. I worked in a ASP.NET MVC web application which used to make call to Web API service hosted at different server. The Web API service was shared among multiple applications. We were consuming it by making AJAX calls from client.
Something similar to your scenario is done at below link but they are using cloud to host service:
http://www.codeproject.com/Articles/529109/Mobile-2fWebplusClient-2cplusWebplusAPIplusandplus
If you have opportunity to make a web app for mobile instead of native app, then in a single solution both mobile and desktop app can be created. The exemplary solution can be found here: http://nopcommerce.codeplex.com/
Thanks and free free to discuss more in case of further questions.

How to create Rest Web service client and server

Hi I need to use REST web service but not getting how to start. Although I have checked different articles but there is no proper example which tells flow of REST SERVER and REST CLIENT. Is there any good example link which tells how a REST server will be created with php and how this web service will be called with which technique. I need web service to show customers and then update customers using web service as well. I need to create my own web service for my application so I need to create both Rest server and Rest client.
Thanks
Crinch
REST isn't a technology, it's a style of software architecture
If you want some concrete examples and a simple framework to get started, try cherrypy, which is a minimal web framework written in python.
This should get you started with a web server that can help you adhere to REST design principles.
You Can Try PHP REST Data services https://github.com/chaturadilan/PHP-Data-Services

Developing backend Webservice and Database for iPhone App for Standalone person

I want to develop my iPhone app but I am not sure what could be the options I have for hosting database and webservice to communicate with my iPhone App. Could someone please suggest me what could be the best way to go for this?
I know how to build everything but never come across this situation. I have been working in environment where we ask Admin to give us Server where we host everything but if I want to do it myself and don't have server infrastructure what could be the options do I have? Do I need to purchase from web hosting provider?
Thanks.
From my experience, I've developed back-end part for iPad client. It was REST, ASP.NET Web API (WCF Web API) and as database on back-end MS SQL Server and MySQL.
Anyway for mobile clients you can freely use REST. It can be ASP.NET Web API from .NET or other libraries that help to make REST services for example from Java.
REST is good consumed by mobile client applications. And then from client application perspective, it's no matter what database back-end will have.
Speaking about hosting it also depends from requirements to back-end. When you have no server infrastructure, you can use cloud PaaS like Amazon AWS (EC2) for example. Or host server it by yourslef.