Data Interaction between Windows Mobile apps and WebServices

Source: Internet
Author: User
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.