Android and C # WebService based Ksoap Communication (C # article)

Source: Internet
Author: User

1. Open the VS 2013 new project >>asp. NET empty Web application (I'm using. NET 4.0)

2. Add a new item (WebService) to the newly created project

At this point the Testservice code such as the following:

usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingsystem.web;usingSystem.web.services;namespace androidserver{//   <summary>     ///   testservice Summary description    //   </summary> [WebService (Namespace ="http://tempuri.org/"] [WebServiceBinding (ConformsTo = wsiprofiles.basicprofile1_1)] [System.ComponentModel.ToolboxItem (false)]//To agree to use ASP. NET AJAX to invoke this Web service from a script, uncheck the line below.     //[System.Web.Script.Services.ScriptService]     Public classTestService:System.Web.Services.WebService {[WebMethod] Public string HelloWorld()        {return "Hello World"; }    }}

3. Right-click on the Project > announce

Note: It is assumed that the IIS feature must be turned on before you open the IIS feature

4. Then the next step
5. In the browser input: Http://localhost/TestService.asmx
Assuming that the following page is present, for example, the. NET version number of the IIS site differs from the project version number (Project version number is 4.0)

A. Open IIS Manager. Right-click on the site > Manage sites > Advanced Settings ... View the following application connection pool as: Default Web Site

B.
6. Refresh the browser page to show normal

7. Click on the HelloWorld> call on the screen, assuming the demo sample is as follows, the configuration is complete

The next article introduces the Android side

Android and C # WebService based Ksoap Communication (C # 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.