vs2012 webservice创建
标签:style class blog http com width
第一步:打开VS2012,新建空项目,注意选择.NET Framework的版本.这里我选择的是.NET Framework 4

新建好项目后,在项目中添加一个WebService项

打开这个文件,我们可以看到,代码如下
[csharp] view plaincopyprint?
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Services;
-
- namespace CalculateService
- {
- ///
- /// WebService1 的摘要说明
- ///
-
-
- [WebService(Namespace = "http://tempuri.org/")]
- [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
- [System.ComponentModel.ToolboxItem(false)]
- // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消注释以下行。
- // [System.Web.Script.Services.ScriptService]
- public class CalCulService : System.Web.Services.WebService
- {
-
- [WebMethod]
- public string HelloWorld()
- {
- return "Hello World";
- }
- }
- }
接下来我们要将这个WebService打包发布
在项目上点击右键,点击菜单中的发布

此时出现如下页面

点击下拉菜单选择新建配置文件







vs2012 webservice创建,搜素材,soscw.com
vs2012 webservice创建
标签:style class blog http com width
原文地址:http://www.cnblogs.com/songling/p/3793918.html
评论