WebServiceBindingAttribute.Location Свойство
Определение
Важно!
Некоторые сведения относятся к предварительной версии продукта, в которую до выпуска могут быть внесены существенные изменения. Майкрософт не предоставляет никаких гарантий, явных или подразумеваемых, относительно приведенных здесь сведений.
Получает или задает расположение, где определена привязка.
public:
property System::String ^ Location { System::String ^ get(); void set(System::String ^ value); };
public string Location { get; set; }
member this.Location : string with get, set
Public Property Location As String
Значение свойства
Расположение, где определена привязка. По умолчанию это URL-адрес веб-службы XML, к которой применяется этот атрибут.
Примеры
В следующем примере задается привязка с именем RemoteBinding
, которая является членом http://www.contoso.com/MyBinding
пространства имен и определена по адресу http://www.contoso.com/MyService.asmx?wsdl
.
<%@ WebService language="C#" class="BindingSample" %>
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
// Binding is defined on a remote server, but this XML Web service
// implements at least one operation in that binding.
[ WebServiceBinding(Name="RemoteBinding",
Namespace="http://www.contoso.com/MyBinding",
Location="http://www.contoso.com/MyService.asmx?wsdl")]
public class BindingSample
{
[ SoapDocumentMethod(Binding="RemoteBinding")]
[ WebMethod() ]
public string RemoteBindingMethod()
{
return "Member of a binding defined on another server";
}
}
<%@ WebService language="VB" class="BindingSample" %>
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
' <Snippet1>
' Binding is defined on a remote server, but this XML Web service implements at
' least one operation in that binding.
<WebServiceBinding(Name := "RemoteBinding", _
Namespace := "http://www.contoso.com/MyBinding", _
Location := "http://www.contoso.com/MyService.asmx?wsdl")> _
Public Class BindingSample
<SoapDocumentMethod(Binding := "RemoteBinding"), WebMethod()> _
Public Function RemoteBindingMethod() As String
Return "Member of a binding defined on another server"
End Function
End Class
' </Snippet1>