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)