SoapDocumentServiceAttribute.RoutingStyle 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置将 SOAP 消息发送到 XML Web services 的方式。
public:
property System::Web::Services::Protocols::SoapServiceRoutingStyle RoutingStyle { System::Web::Services::Protocols::SoapServiceRoutingStyle get(); void set(System::Web::Services::Protocols::SoapServiceRoutingStyle value); };
public System.Web.Services.Protocols.SoapServiceRoutingStyle RoutingStyle { get; set; }
member this.RoutingStyle : System.Web.Services.Protocols.SoapServiceRoutingStyle with get, set
Public Property RoutingStyle As SoapServiceRoutingStyle
属性值
SoapServiceRoutingStyle,表示将 SOAP 消息发送到 XML Web services 的方式。 默认值是 SoapAction。
示例
<%@ WebService Language="c#" Class="SumService" %>
using System;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Web.Services.Description;
[SoapDocumentService(SoapBindingUse.Literal,
SoapParameterStyle.Wrapped,
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
<SoapDocumentService(SoapBindingUse.Literal, _
SoapParameterStyle.Wrapped, _
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