SoapRpcServiceAttribute 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
初始化 SoapRpcServiceAttribute 类的新实例。
public:
SoapRpcServiceAttribute();
public SoapRpcServiceAttribute ();
Public Sub New ()
示例
下面的示例演示如何创建 SoapRpcServiceAttribute 类的实例。
<%@ WebService Language="c#" Class="SumService" %>
using System;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Web.Services.Description;
[SoapRpcService(RoutingStyle=SoapServiceRoutingStyle.SoapAction)]
public class SumService : System.Web.Services.WebService
{
[WebMethod]
public int Add(int a, int b)
{
return a + b;
}
}
<%@ WebService Language="VB" Class="SumService" %>
Imports System
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Web.Services.Description
<SoapRpcServiceAttribute(RoutingStyle:=SoapServiceRoutingStyle.SoapAction)> _
Public Class SumService
Inherits System.Web.Services.WebService
<WebMethod> _
Public Function Add(a As Integer, b as Integer)
return a + b
End Function
End Class