The task of an embedded device is of to "run forever" without intervention performing a specific task as an outcrop of a service. For example it may have sensors that periodically return climatic data or return activity data when events occur in its realm. To demonstrate that functionality the GetTime application will be modified to request the formatted DateTime string from a remote service. In particular a Web Service will be used to service the DateTime request from the Compact 2013 client. Whilst it is the Compact 2013 system that is data consumer, it would not be hard for the web method to modified so that it consumed data submitted to it by the Compact 2013 device.
Create a web service to generate the Date/Time string as an XML string. The web service will be written in C# and may reside on the development system or elsewhere except the target Compact 2013 system. The simplest option is to implement it on a system that has IIS implemented, which could even be Azure!. If no IIS web server is available, use the Visual Studio (Virtual) Web Server but you will need something like Fiddler to do port redirection because the Visual Studio server can only be used in the local context. Note that any emulator or virtual machine does not run in the local context of its host.
Normally a web reference is added to a .NET app in the project context in Solution Explorer. Once added to a project, the web service is instantiated as an object instance of the web service class, with the required web method being a method of that object. Unfortunately the addition of web methods in the Visual Designer this has not been implemented for .NET CF 3.9. It has though been implemented with Compact 7-Smart Device projects. The solution is to generate the app project with the web reference in that context and either copy the binary to the Compact 2013 system or copy the required web reference code and resources from the Compact 7 app project to the Compact 2013 project. The first method is simplest but debugging would need to resolved on the Compact 7 system. The second method is much more complex and can be considered "a hack". But once implemented it facilitates debugging and extensions in the Compact 2013 app development context.
Being Managed Code the compiled Visual Studio 2008 version of the app should be compatible with Compact 2013 on a system with .NET Compact Framework.
This activity is fraught with danger in that it requires directly modifying the application project file, .csproj. It is doable and does work though.
NEXT: Merging the Web References from a VS2008 SmartDevice project into a Compact 2013 C# Project
Click here to provide feedback and input