ArticleDirectory
- This article briefly introduces
This article briefly introduces
Applications on Windows MobileProgramIn addition to data interaction with the local SQL Server ce and remote WebService communication, this process is basically similar to winform development. We can first establish a solution, this includes a Windows Mobile Application project and a web site. You only need to add a WebService page to a Web site. Here, the default page is used, this service has only one default internal method helloworld. When the Windows Mobile Application calls this method, it can receive Hello, world!
Step 1 create a WebService and a Windows Mobile Application
There is only one simple method helloworld () in werservice ();
Step 2: Add a web reference to the Windows Mobile Application. The default reference name is
After adding a reference, add a button on the default form1 to trigger a WebService event. You can add the following call to the button click event:Code:
Private void button#click (Object sender, eventargs E)
{
Localhost. Service Ws = new smartdeviceproject1.localhost. Service ();
MessageBox. Show ("Message from WebService:" + WS. helloworld ());
}
In this way, the test is completed, but there is a problem here, that is, the code in webcast is found when searching for materials, and the WebService address is not:
HTTP: /localhost: 4534/website2/WebService. asmx
That is to say, the WebService address uses the PC name rather than localhost. Instead, enter the Intranet IP address of the Local Machine: port number, such as http: // 192.168.1.6: 3900 // path ......
Windows Mobile + webservice-1 and Windows Mobile + webservice-2
Link: http://www.cnblogs.com/wengyuli/archive/2010/04/17/windows-mobile-webservice.html