易截截图软件、单文件、免安装、纯绿色、仅160KB

asp.net构建Web服务基础(含SOAP相关知识)

WSDL:是一个用来描述Web服务和说明如何与Web服务通信的XML语言。 怎样向别人介绍你的Web service有什么功能,以及每个函数调用时的参数等等。
 
web服务:进行web上数据交换的方法。能够以纯xml方式通信。
 
SOAP:简单对象存取协议。可看做xml方言; 以SOAP信封来传递和响应文本(包含:首部、主体)HTTP POST
 
VS中建立web服务项目 (vs自动生成soap信封)
 
主文件Service.cs 如下:
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : System.Web.Services.WebService
{
public Service () {
//如果使用设计的组件,请取消注释以下行
//InitializeComponent();
}
[WebMethod]
public string HelloWorld(string name) {
return "Hello World!"+name;
}

}

运行项目返回xml数据:
<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://tempuri.org/">Hello World!homsky</string>


相关文档:

关于ASP.NET/C#中对Cookie的操作

写cookie
  1 HttpCookie cookie = new HttpCookie("Info");//定义cookie对象以及名为Info的项
  2 DateTime dt = DateTime.Now;//定义时间对象
  3 TimeSpan ts=new TimeSpan(1,0,0,0);//cookie有效作用时间,具体查msdn
  4 cookie.Expires = dt.Add(ts);//添加作用时间
  5 cookie.Values.Add("user","cx ......

Paging long articles in ASP.NET using C#

Paging long articles in ASP.NET using C#
Long articles are better broken into bite-sized chunks over several pages. With static HTML, this is easily achieved by dividing the article into logical separations and creating separate .htm files for each. Here's how to do it using C# for an article that ......

ASP.NET自定义错误页面

ASP.NET 提供三种用于在出现错误时捕获和响应错误的主要方法:Page_Error 事件、Application_Error 事件以及应用程序配置文件 (Web.config)。
如果您不调用 Server.ClearError 或者捕获 Page_Error 或 Application_Error 事件中的错误,则将根据 Web.config 文件的 <customErrors> 部分中的设置处理错误。在 <cus ......

ASP.NET中Excel操作类C#版

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.Office.Inter ......

ASP.NET 2.0中Page事件的执行顺序

Page 执行中将按照如下顺序激活事件:
Page.PreInit
Page.Init
Page.InitComplite
Page.PreLoad
Page.Load
Page.LoadComplete
Page.PreRender
Page.PreRenderComplete
如果页面从令一个页面继承,如BasePage:System.Web.UI.Page,在BasePage中做了一些扩展,如权限检查,而其他页面从BasePage继承,则BasePage和最 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号