简体   繁体   English

建立一个完整的Web服务,网站和iPhone应用程序

[英]Architechting a complete web service, website, and iphone app

I am trying to architect a system that will have a website and an iphone app that will be driven off the same data. 我正在尝试构建一个系统,该系统将拥有一个网站和一个将被驱逐出相同数据的iPhone应用程序。 I understand how I would create and architect the website, but when it comes to adding the iphone app I am unsure on how it will apply. 我理解如何创建和构建网站,但在添加iPhone应用程序时,我不确定它将如何应用。

My considerations for design: 我对设计的考虑:

-Using C#, SQL Server, asp.net for the website (would try to get most of my data using web services where I could) - 使用C#,SQL Server,asp.net作为网站(尽可能使用网络服务来获取我的大部分数据)

-Using Objective-C, x-code, etc for the iphone app development - 使用Objective-C,x-code等进行iphone应用程序开发

1.) Will I need to expose a web service for the iphone to interact with? 1.)我是否需要为iphone公开网络服务以进行交互? If so, would that be considered a seperate web app from the actual website? 如果是这样,它会被视为来自实际网站的单独的网络应用程序吗? Or would the webservice be built in with the website and then the iphone would interact with that web service as well? 或者网络服务是否会与网站一起构建,然后iphone也会与该网络服务进行交互?

2.) What do I need to consider, security wise, when it comes to exposing a web service? 2.)在公开Web服务时,我需要考虑哪些安全性?

3.) Any other architecture advice for building a system such as this? 3.)用于构建此类系统的任何其他架构建议? Maybe personal experiences with doing a website/iphone app that runs off the same database. 也许是做一个运行在同一个数据库中的网站/ iphone应用程序的个人经历。

  1. Yes you will need to expose a webservice for the application to bind/talk to. 是的,您需要公开一个Web服务,以便应用程序绑定/通话。 I would suggest that the service be run as a separate site (such as data.yourdomain.com, where as the site would run on yourdomain.com) which the website also uses for it's data. 我建议该服务作为一个单独的站点运行(例如data.yourdomain.com,该站点将在yourdomain.com上运行),该站点也使用该站点的数据。 That way you share the same architecture for both your "end points" (site and app). 这样,您就可以为“端点”(站点和应用程序)共享相同的体系结构。

  2. Ensuring that you webservice takes a authentication token (username/password or oauth/etc) with each call will help to prevent any unauthorised calls to the service/database. 确保您的webservice在每次调用时都使用身份验证令牌(用户名/密码或oauth / etc),这有助于防止对服务/数据库进行任何未经授权的调用。 Also ensuing that your service is exposed via a valid HTTPS connection (and only https) will prevent sniffing of the data to get passwords. 此外,通过有效的HTTPS连接公开您的服务(并且只有https)将阻止嗅探数据以获取密码。

  3. As I said in point 1, build the service in such a way that it does not matter what "end point" is accessing it. 正如我在第1点所说的那样,以这样一种方式构建服务,即“端点”访问它并不重要。 That way should you add an android app or windows phone app (or even a second website) you will not need to make a fresh service. 这样你应该添加一个Android应用程序或Windows手机应用程序(甚至第二个网站),你不需要提供新的服务。 Perhaps tie each applications "account" to a "end point type" (such as Android/iPhone/WinPhone/WebSite) that will allow you to customise the data objects that you return if needed. 也许将每个应用程序“帐户”绑定到“端点类型”(例如Android / iPhone / WinPhone / WebSite),这将允许您自定义您在需要时返回的数据对象。

Will I need to expose a web service for the iphone to interact with? 我是否需要为iphone提供与之交互的Web服务? If so, would that be considered a seperate web app from the actual website? 如果是这样,它会被视为来自实际网站的单独的网络应用程序吗? Or would the webservice be built in with the website and then the iphone would interact with that web service as well? 或者网络服务是否会与网站一起构建,然后iphone也会与该网络服务进行交互?

It depends, if you want a native application, then you would expose the service, else you can develop an iPhone web app 这取决于,如果您想要一个本机应用程序,那么您将公开该服务,否则您可以开发一个iPhone Web应用程序

What do I need to consider, security wise, when it comes to exposing a web service? 在公开Web服务时,我需要考虑哪些安全性?

Normal security consideration as if you would develop a web service to a windows desktop application 正常的安全性考虑,就像您要为Windows桌面应用程序开发Web服务一样

Any other architecture advice for building a system such as this? 建立像这样的系统的任何其他架构建议? Maybe personal experiences with doing a website/iphone app that runs off the same database. 也许是做一个运行在同一个数据库中的网站/ iphone应用程序的个人经历。

Try to make the web service as clear and light as you can 尽量使网络服务尽可能清晰明亮

At first use use just one data source for all your projects. 首次使用时,只需为所有项目使用一个数据源。 Expose the database with webservices. 使用webservices公开数据库。 User authentication to invoke webservice procedures for security. 用户身份验证以调用Web服务过程以确保安全性。

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

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