由于本文并非WinCE开发普及篇,所以一些WinCE开发和WCF开发的基础还请移步百度和谷歌寻找答案,然后结合本文开发出WinCE中如何访问WCF,谢谢。
开发环境
IDE:Visual Studio 2008 (2010、2012、2013目前都不支持)
OS:Win 7 (64位)
Tools:ActiveSync win7 v6.1(设备中心,给Pocket PC 2003模拟器提供网络)
模拟器网络连接攻略一份:http://www.jb51.net/softjc/42088.html
创建WinCE项目
请恕本文并非WinCE开发普及篇,所以这些请百度吧。
WCF服务端
app.config中关键代码
View Code<service behaviorConfiguration="SystemDispatchServiceForPDABehavior" name="SystemManageServiceLibrary.SystemDispatchServiceForPDA"> <!--PDA系统分配--> <endpoint address="http://localhost:20003/SystemDispatchForPDA/SystemDispatchServiceForPDA" binding="webHttpBinding" contract="SystemManageServiceLibrary.SystemDispatch.ISystemDispatchServiceForPDA" > </endpoint> <!--PDA系统分配元数据--> <endpoint address="http://localhost:20003/SystemDispatchForPDA/SystemDispatchServiceForPDA/mex" binding="mexHttpBinding" contract="IMetadataExchange" /> <host> <baseAddresses> <add baseAddress="http://localhost:20003/SystemDispatchForPDA"/> </baseAddresses> <timeouts openTimeout="00:00:30" /> </host> </service>