Download presentation
Presentation is loading. Please wait.
1
MBL 327 Windows Mobile开发中的异构系统集成
2
课程内容概述 当前企业在IT系统上已经进行了大量的投资,企业内部部署了使用各种技术的业务系统。在基于Windows Mobile系统的移动企业开发中不可避免要和各种异构系统交互。本次讲座将向大家展示使用webservice以及移动webbrowser ActiveX控件如何将一个基于JSF的J2EE web应用整合到Windows Mobile的应用中。本次课程面向基于Windows Mobile的移动应用开发人员。听众需要掌握.NET Compact Framework、webservice、Visual Studio .NET等相关知识。
3
课程内容安排 Demo 异构平台 Webservice: 异构系统的粘合剂 WebBrowser ActiveX控件:驻留Web内容
其他技巧
4
12/4/2018 8:51 AM Demo 4 © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
6
12/4/2018 8:51 AM 异构平台 6 © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
7
异构平台 异构的技术架构: .NET、Java、Python、PHP、Ruby on Rails etc…
异构的程序架构:Client/Server、 Browser/Server
8
Webservice: 异构系统的粘合剂 12/4/2018 8:51 AM 8
© 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
9
Webservice: 异构系统的粘合剂 工业标准 基于Http-XML ,能穿透防火墙 程序和代码的复用
10
Webservice: 异构系统的粘合剂 Webservice开发中的问题及技巧
互操作问题:序列化( Serialize )和反序列化( DeSerialize ) 生成您自己的.NET webservice代理
11
Webservice: 异构系统的粘合剂 Webservice开发中的问题及技巧 您不可以在异构系统之间传递例如java.io.File对象
互操作问题:序列化( Serialize )和反序列化( DeSerialize ) 您不可以在异构系统之间传递例如java.io.File对象 您不可以在异构系统之间传递Java中已经序列化的对象例如:javax.swing.JPanel 推荐传输基本数据类型/数组类型 自定义的Java数据对象需要实现JavaBean规范 注意:SOAP 不是 Corba, RMI, RMI-IIOP, .NET remoting, DCOM(+),或者其他典型的远程对象调用机制。
12
Webservice: 异构系统的粘合剂 Webservice开发中的问题及技巧 .NET端的webservice消费者/代理
强烈建议在Visual Studio .NET中生成一个独立的项目作为webservice的客户端 易于debug,低耦合性
13
WebBrowser ActiveX控件:驻留Web内容
12/4/2018 8:51 AM WebBrowser ActiveX控件:驻留Web内容 13 © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
14
WebBrowser ActiveX控件:驻留Web内容
WebBrowser控件能够无缝的将B/S应用整合到C/S应用中 .NET Compact Framework支持基本的桌面版的WebBrowser控件功能
15
WebBrowser ActiveX控件:驻留Web内容
API bug 不被支持的属性/方法/事件……
16
WebBrowser ActiveX控件:驻留Web内容
API Bug 当使用.NET CF中的WebBrowser控件访问一个新的URL的时候会触发两次Navigated和DocumentCompleted事件 这个Bug不影响基于Windows CE5的PPC和SP,这个问题会在未来版本的CE中修复
17
WebBrowser ActiveX控件:驻留Web内容
不被支持的属性/方法/事件…… .NET Compact Framework不支持Document属性以及相关的属性、事件,除了DocumentText属性 DocumentText是只写的属性 没有DOM对象,不可以遍历HTML中的elements
18
WebBrowser ActiveX控件:驻留Web内容
Tricks 获取当前访问页面的HTML内容可以使用HttpWebRequest,HttpWebResponse以及SteamReader得到 WebRequest req = (HttpWebRequest)WebRequest.Creat(url); WebResponse res = (HttpWebResponse)req.GetResponse(); StreamReader reader = new StreamReader(res.GetResponseStream()); String output = reader.ReadToEnd(); reader.Close(); res.Close();
19
12/4/2018 8:51 AM 其他技巧 19 © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
20
其他技巧 在WinForm中隐藏TabPage 启用Virtual Machine Network服务,连接本机网络
动态的webservice URL地址引用
21
其他技巧 在WinForm中隐藏TabPage TabPage控件没有实现Hide()方法
private TabPage savedPage; private void hideWFPage() { savedPage = this.tabControl1.TabPages[1]; this.tabControl1.TabPages.RemoveAt(1); } private void showWFpage(){ if (savedPage != null) { this.tabControl1.TabPages.Add(savedPage);
22
其他技巧 启用Virtual Machine Network服务,连接本机网络 安装Virtual Machine Network服务
在模拟器中设置NE2000 PCMICA network adapter and bind to选项 连接到“工作网络”
23
其他技巧 动态的webservice URL地址引用 动态的webservice URL地址引用
在生产环境中部署应用使用应用程序配置文件(app.config)
Similar presentations