用于 Web & 的独立 ServiceStack 服务原生移动应用 [英] Standalone ServiceStack service for Web & Native Mobile App

查看:17
本文介绍了用于 Web & 的独立 ServiceStack 服务原生移动应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的架构由几个后端(非 ServiceStack)服务和应用程序组成,这些服务和应用程序通过托管在 asp.net 中的 ServiceStack 服务将数据发送到我们的系统 - 这是目前一个独立的 ServiceProject 项目,包含我们所需的服务/存储库/DTO 结构所有提供的 ServiceStack 示例.

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.

后端完成后,我们现在正在设计我们的两个前端需求,包括 Web 应用程序和本机移动应用程序.对于 Web 应用程序,我真的很想继续利用 ServiceStack,通过使用 Razor 插件从我们现有的 DTO 创建应用程序的布局/视图,对于我们的移动应用程序,我们将只依赖 ServiceStack 服务进行身份验证和数据 - 就像它一样原生它的布局/视图将来自它自己的 SDK.

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.

我可以保留我的独立 ServiceStack 服务吗:

  1. 创建一个单独的 Web 应用程序项目来进行身份验证针对我们现有的独立 ServiceStack 服务并使用剃刀视图插件?
  2. 拥有我们的原生移动应用客户端针对同一个独立的 ServiceStack 服务进行身份验证?

大多数示例即.RazorRockstars 我已经看到在 web 项目中嵌入了服务,所以我不确定这种分布式类型的支持设置.非常感谢您对此的任何指导或反馈!

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!

推荐答案

很有可能.您可以从 Web 和本机移动应用程序使用 Web 服务.我在 ASP.NET MVC Web 应用程序中工作,该应用程序用于调用托管在不同服务器上的 Web API 服务.Web API 服务在多个应用程序之间共享.我们通过从客户端进行 AJAX 调用来使用它.

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.

在下面的链接中完成了与您的场景类似的事情,但他们使用云来托管服务:http://www.codeproject.com/Articles/529109/Mobile-2fWebplusClient-2cplusWebplusAPIplusandplus

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

如果您有机会为移动设备而不是本机应用程序制作网络应用程序,那么可以在一个解决方案中同时创建移动和桌面应用程序.示例性解决方案可以在这里找到:http://nopcommerce.codeplex.com/

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.

这篇关于用于 Web & 的独立 ServiceStack 服务原生移动应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆