How to create simple web service in VS2010, NOT WCF service

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:

< div> <? xml version="1.0" encoding="utf-8" ?> </div> <div> <div style="TEXT-INDENT: -2em; MARGIN-LEFT: 1em" mce_style="TEXT-INDENT: -2em; MARGIN-LEFT: 1em">    < string xmlns = http://tempuri.org/ > Hello World </ string > </div> <div style="TEXT-INDENT: -2em; MARGIN-LEFT: 1em" mce_style="TEXT-INDENT: -2em; MARGIN-LEFT: 1em"> </div> <div style="TEXT-INDENT: -2em; MARGIN-LEFT: 1em" mce_style="TEXT-INDENT: -2em; MARGIN-LEFT: 1em">    Hello World is the return value of the HelloWorld method</div> <div style="TEXT-INDENT: -2em; MARGIN-LEFT: 1em" mce_style="TEXT-INDENT: -2em; MARGIN-LEFT: 1em"> </div> <div style="TEXT-INDENT: -2em; MARGIN-LEFT: 1em" mce_style="TEXT-INDENT: -2em; MARGIN-LEFT: 1em">    You're off and running.. Have Fun.</div> <div style="TEXT-INDENT: -2em; MARGIN-LEFT: 1em" mce_style="TEXT-INDENT: -2em; MARGIN-LEFT: 1em"> </div> <div style="TEXT-INDENT: -2em; MARGIN-LEFT: 1em" mce_style="TEXT-INDENT: -2em; MARGIN-LEFT: 1em"> </div></div>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值