博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
在IIS6上部署WebService
阅读量:7001 次
发布时间:2019-06-27

本文共 1035 字,大约阅读时间需要 3 分钟。

在IIS6上部署WebService

2016-12-07

目录:

1

2
3

1 创建web service项目


  

用Visual Studio模板“ASP.NET Web 服务应用程序”新建项目。

其它不变,只增加WebMethod Add方法,如下图1所示 

图1 创建Web Service项目

把WebService1.dll放在目录D:\Study\WebSerice\bin下,把Service1.asmx和Web.config放在目录D:\Study\WebSerice下,代码如下:

Service1.asmx.cs代码:

using System.Web.Services;namespace WebService1{    ///     /// Service1 的摘要说明    ///     [WebService(Namespace = "http://tempuri.org/")]    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]    [System.ComponentModel.ToolboxItem(false)]    public class Service1 : System.Web.Services.WebService    {        [WebMethod]        public float Add(float a,float b)        {            return a + b;        }    }}

Service1.asmx代码:

<%@ WebService Language="C#" CodeBehind="Service1.asmx.cs" Class="WebService1.Service1" %>

Web.config代码:

2 部署WebService


 

部署跟 中的一致

3 浏览页面


 

进入Add页面,输入参数后可以调用add方法

 

转载于:https://www.cnblogs.com/Ming8006/p/6140008.html

你可能感兴趣的文章
postman 中调试接口的小记录
查看>>
PHP一句话
查看>>
python 向上取整ceil 向下取整floor 四舍五入round
查看>>
php排序算法
查看>>
在if里赋值要注意=和==的优先级,==优先于=
查看>>
Delphi xe7 up1 调用android振动功能
查看>>
激励自己的话
查看>>
IOS 实现界面本地化(国际化)
查看>>
陶哲轩实分析命题 11.10.7
查看>>
《陶哲轩实分析》引理17.2.4证明_导数的唯一性
查看>>
站立会议5
查看>>
python中的常用模块(2)
查看>>
登陆的键盘敲击事件
查看>>
执行计划基础 统计信息
查看>>
python MD5加密方法
查看>>
mysql连接jdbc查询代码
查看>>
SpringMVC10数据验证
查看>>
处理异常Error resolving template [/login], template might not exist or might not be accessible by......
查看>>
洛谷 P1147 连续自然数和 Label:等差数列
查看>>
线程间的同步和通信机制
查看>>