webservice的简单介绍

本文介绍了WebService技术的关键组成部分:WSDL、SOAP和UDDI,并通过一个.NET平台上的具体示例展示了如何创建一个简单的WebService服务。该示例使用C#语言编写,包括了WebService的基本配置和服务方法的定义。

Web Services技术的组成要素

¢WSDL
¢SOAP
¢UDDI
 
.NET Web Service的实现
Service1.cs

using System;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Data;
using System.Web.Services.Protocols;
using System.Web.Services.Description;
using Microsoft.ApplicationBlocks.ExceptionManagement;
using System.Configuration;
using System.Net;


[WebService(Namespace = "http://www.1111.com")]
//[System.Xml.Serialization.SoapIncludeAttribute(typeof(PropertyData))]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[SoapDocumentService(SoapBindingUse.Literal,
SoapParameterStyle.Wrapped,
RoutingStyle = SoapServiceRoutingStyle.RequestElement)]
public class Service1 : System.Web.Services.WebService
{

[WebMethod]

public string HelloWorld()

{

return "Hello World";

}

}

 

调用

Service1.asmx

<%@ WebService Language="C#" CodeBehind="~/App_Code/Service1.cs" class="Service1" %>

 


本文转自linzheng 51CTO博客,原文链接:http://blog.51cto.com/linzheng/1081858

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值