ImageVerifierCode 换一换
格式:PPT , 页数:27 ,大小:783.06KB ,
资源ID:378479      下载积分:2000 积分
快捷下载
登录下载
邮箱/手机:
温馨提示:
如需开发票,请勿充值!快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝扫码支付 微信扫码支付   
注意:如需开发票,请勿充值!
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【http://www.mydoc123.com/d-378479.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(App ServicesDeveloper's Guide to Windows 10.ppt)为本站会员(twoload295)主动上传,麦多课文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知麦多课文库(发送邮件至master@mydoc123.com或直接QQ联系客服),我们立即给予删除!

App ServicesDeveloper's Guide to Windows 10.ppt

1、App Services Developers Guide to Windows 10,Agenda,What are App Services? App Services Scenarios App Services Client App Services Server Debugging Tips Debugging an App Service App Services Details App Service Lifetime Implementing a client SDK Controlling Access Versioning,What are App Services?,Ap

2、p Service: Special case of Background Task,Client App A,Client App B,Background Task,App with App Service,Scenario: Bar Code Scanning,Bar Code decoding App Service,Image bytes in ValueSet or FileToken,Decoded data,Scenario: Enterprise suite of apps,App Service Maintains Inventory cache,Client App A,

3、Client App B,Interact with cloud services,App Service Proximity Reading Services,Think of App Services as Web services on device,App Services Client,AppServiceConnection connection = new AppServiceConnection(); connection.AppServiceName = “microsoftDX-appservicesdemo“; connection.PackageFamilyName =

4、 “24919ArunjeetSingh.InstapaperIt“; AppServiceConnectionStatus connectionStatus = await connection.OpenAsync(); if (connectionStatus = AppServiceConnectionStatus.Success) /Send data to the service var message = new ValueSet(); message.Add(“Command“, “CalcSum“); message.Add(“Value1“, Int32.Parse(Valu

5、e1.Text); message.Add(“Value2“, Int32.Parse(Value2.Text); /Send message and wait for response AppServiceResponse response = await connection.SendMessageAsync(message); if (response.Status = AppServiceResponseStatus.Success) int sum = (int)response.Message“Result“; new MessageDialog(“Result=“ + sum).

6、ShowAsync(); ,App Services Service (1/2),namespace AppServicesDemoTask public sealed class AppServiceTask : IBackgroundTask private static BackgroundTaskDeferral _serviceDeferral; public void Run(IBackgroundTaskInstance taskInstance) var appService = taskInstance.TriggerDetails as AppServiceTriggerD

7、etails; if (appService.Name = “microsoftDX-appservicesdemo“) / Hook up the RequestReceived event handler appService.AppServiceConnection.RequestReceived += RequestReceived; .,App Services Service (2/2),private async void RequestReceived(AppServiceConnection sender, AppServiceRequestReceivedEventArgs

8、 args) var message = args.Request.Message; / This service uses a Command keyed entry for the client to invoke services from the App Service string command = message“Command“ as string; switch (command) case “DoIt“: var messageDeferral = args.GetDeferral(); int value1 = (int)message“Value1“; . Do som

9、e processing /Set a result to return to the caller var returnMessage = new ValueSet(); returnMessage.Add(“Result“, result); var responseStatus = await args.Request.SendResponseAsync(returnMessage); messageDeferral.Complete(); break; . ,Declaring App Service,Two-way Communication,Client and server ca

10、n keep a two-way chatty communication channel open Client can attach a RequestReceived event handler to its own AppServiceConnection instanceBoth client and server can send and receive messages,AppServiceConnectionStatus connectionStatus = await connection.OpenAsync(); if (connectionStatus = AppServ

11、iceConnectionStatus.Success) connection.RequestReceived += OnRequestReceived; ,Debugging Tips,Getting the PackageFamilyName for the App Service Debugging your App Service,Getting the Service PackageFamilyName,Store Associate App with the Store sets the store assigned PackageFamilyName You dont have

12、to associate your app for testing! Call Package.Current.Id.FamilyName to return PFN to use in debugging,Debugging App Services,Set breakpoints in app service code Check Do not launch but debug my code when it starts in project properties Launch app service foreground app in debugger nothing happens!

13、 Run client app to connect to app service Debugger attaches and breaks on your breakpoint,Demo: App Services,More considerations on App Services,App Service Lifetime,Service is activated on-demand Background Task activated by means of an AppServiceTrigger Client may terminate service by disposing it

14、s AppServiceConnection You can build in capability for your service to shutdown through a message from a client If the invoking app is suspended, app services sponsored by the app will be terminated Insufficient resources may cause launch failure or service termination Invoking app will get AppServi

15、ceConnectionStatus.ResourcesNotAvailable when connecting May get AppServiceResponseStatus.ResourceLimitsExceeded when sending message,What Protocol?,App Services are designed to be flexible and light-weight and are modelled on web REST Web services Simple Request-Response message API Data packaged a

16、s string-keyed ValueSets Easy to use with multiple different payloads When you publish an App Service, you are defining a communications endpoint An App Service endpoint provides the Caller a way to send data to the Callee An App Service endpoint also provides the Caller a way to request return valu

17、es from the Callee and for the Callee to respond with these return values.,App services provides another way for applications to communicate with each other,Nice to do: Implementing a Client SDK ,Wrap the low-level service communication implementation details inside a more functional set of methods

18、Publish a client SDK for your service Distribute as a NuGet package or by other means,Can I restrict access to my App Service?,Build your own caller validation mechanisms on top of app services Simplest is for service provider to whitelist callers based on their PackageFamilyName PackageFamilyName o

19、f caller is passed with every request Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been established Whitelist could be followed by explicit X.509 certificate exchange,Versioning,Follow the Web REST API versioning model If you need to make

20、a breaking change to an App Service endpoint, you must expose a new endpoint and provide backward compatibility with the old one,Demo: App Services client library,Final Thoughts,Its not just about XAML Windows App clients! See Calling an App Service from a WPF/WinForms Win32 App https:/ Arun at aruntalkstech,Review,What are App Services? App Services Scenarios App Services Client App Services Server Debugging Tips Debugging an App Service App Services Details App Service Lifetime Building a client API Controlling Access Versioning,

copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
备案/许可证编号:苏ICP备17064731号-1