简体   繁体   English

用于访问SQL Server的UWP服务

[英]UWP service for accessing SQL Server

RE: https://code.msdn.microsoft.com/How-to-access-data-from-5f2602ec RE: https//code.msdn.microsoft.com/How-to-access-data-from-5f2602ec

I'm hoping to clarify some points and concerns. 我希望澄清一些观点和担忧。 When designing UWP for Windows 10 Microsoft, in my own thoughts, short-sightedly left SYSTEM.DATA out of the framework. 在设计UWP for Windows 10 Microsoft时,根据我自己的想法,短视将SYSTEM.DATA从框架中移除。 This means that you must use a WCF web service as a middle man to access any data from SQL Server and return it to your application. 这意味着您必须使用WCF Web服务作为中间人来访问SQL Server中的任何数据并将其返回到您的应用程序。 Here's where I get confused: 这是我感到困惑的地方:

  1. When the app is run from Visual Studio and then stopped, the web service is still running in the background and can be accessed from any browser. 当应用程序从Visual Studio运行然后停止时,Web服务仍在后台运行,可以从任何浏览器访问。 You could easily find the address by using something like fiddler. 你可以通过使用像fiddler这样的东西轻松找到地址。

    This concerns me for because anyone can then see your service and use it and I'm not sure how to obfuscate the service itself. 这让我很担心,因为任何人都可以看到您的服务并使用它,我不知道如何模糊服务本身。

  2. I'm also not sure how the service itself gets bundled and deployed. 我也不确定服务本身是如何捆绑和部署的。 When creating the service reference, you reference a specific address and port. 创建服务引用时,引用特定的地址和端口。 Does it always use that same port no matter where it's installed? 它是否始终使用相同的端口,无论它安装在何处? Does the store app automatically deploy the web service as part of the UWP download/install? 商店应用程序是否自动部署Web服务作为UWP下载/安装的一部分?

Overall, I'm skeptical of the decision they made to exclude system.data and the ability to protect IP or secure your application when you can simply browse to the service address and review the function calls, profile, or decompile. 总的来说,我对他们排除system.data以及保护IP或保护应用程序的能力的决定持怀疑态度,只需浏览服务地址并查看函数调用,配置文件或反编译即可。

I hope I've been clear on my concerns and that some kind soul can entertain them. 我希望我已经清楚我的担忧,并且某种善良的灵魂可以接受它们。

A service is a separate application that you typically deploy to some remote machine, for example in the cloud. 服务是您通常部署到某个远程计算机的单独应用程序,例如在云中。

Your UWP client app connects to this service over the Internet but the service is not packaged and deployed together with your client application. 您的UWP客户端应用程序通过Internet连接到此服务,但该服务未与您的客户端应用程序一起打包和部署。 It may serve several different kind of client applications simultaneously. 它可以同时提供几种不同类型的客户端应用程序。

The client application obviously needs to know the address of the service to be able to connect to it at runtime. 客户端应用程序显然需要知道服务的地址才能在运行时连接到它。

So you basically create two different applications. 所以你基本上创建了两个不同的应用 One service application that reads from and writes to the database and one UWP client application that consumes the remote service application. 一个服务应用程序,用于读取和写入数据库以及一个使用远程服务应用程序的UWP客户端应用程序。 The service application may be deployed to Azure and the UWP application to the Windows Store. 可以将服务应用程序部署到Azure,将UWP应用程序部署到Windows应用商店。

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

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