How to create simple web service in VS2010, NOT WCF service
I had the same issue, however I needed .Net 4.0. The way I created a WebService "Hello World" project using Visual Studio 2010 with .Net 4.0 is as follows:
1. File -> New -> Project
2. Temporarily Select .NET Framework 3.5 from the dropdown list at the top center of the New Project Dialog Box.
3. Select Template "ASP.NET Web Service Application - OK
4. In the Solution Explorer right click on the WebService1 project within the Solution WebService1 - select Properties on the bottom
5. On the Application Tab change the Target framework back to .NET Framework 4.0
6. Confirm all the warning that you'll have to manuall change things, etc.
7. press F5 to start the Hello World App
What should you see:
8: A browser launches with http://localhost:4001/Service1.asmx as the URL with a link named HelloWorld which is the WebMethod
9: Click the HelloWorld Link and click Invoke
10: Output:
<?xml version="1.0" encoding="utf-8" ?>
Hello World is the return value of the HelloWorld method
You're off and running.. Have Fun.
No comments:
Post a Comment