One, install the IIS components in the Control Panel, program and uninstall.
Second, IIS cannot display the WebService. asmx file. Workaround:
1, if you are installed before the VS after the installation of IIS, first register IIS:
command line go to directory: C:\Windows\Microsoft.NET\Framework\v2.0.50727 execute command: Use vs command line, enter command: Aspnet_regiis-i, re-register. NET environment.
2, if the command line run prompt error, you can try to run as Administrator (Win7).
After the update is complete, IIS configures the. NETFramework version of the application pool to v4.0.
Third, go to IIS Manager choose to establish or select a Web site, then right-click Add virtual directory, the physical path to your WebService project, after the completion of the selection of virtual directory right-click the "Go to Application" operation, browse: http://localhost/virtual Directory alias/ Service.asmx, the page displays the method that is called.
Iv. Deployment of IIS
1. Add a site
2. Adding virtual directories
3. Convert to Application
4, click OK.
5. Modify the "default document".
6. Add *.asmx File
7. Select the WebService application and click Browse on the right.
Five, set the URL address
1, remove the. Asxm suffix can also be called, for example:
The normal invocation method is: Http://localhost/WebServiceServer/WebService1.asmx
To change to: http://localhost/WebServiceServer/WebService1?wsdl
(1) When the WebService service is created, add the Global.asax global file.
(2) Open Global.asax file and add code:
protected void Application_BeginRequest (object sender, EventArgs e)
{
String path = Request.Url.ToString ();
Path = Request.Url.LocalPath.ToString ();
if (!path. Contains ("/webservice1.asmx"))
{
if (path. Contains ("/webservice1"))
{
Context.rewritepath (path. Replace ("/webservice1", "/webservice1.asmx"));
}
}
}
Vi. New Site
Resources:
1, http://blog.sina.com.cn/s/blog_6abb49260100lc8z.html
2, http://www.doc88.com/p-418980892612.html
3, http://q.cnblogs.com/q/54872/
4, http://blog.sina.com.cn/s/blog_585657900100036h.html
WebService deployment issues in Windows7