WebServiceBindingAttribute.Location Property

Definition

Gets or sets the location where the binding is defined.

C#
public string Location { get; set; }

Property Value

The location where the binding is defined. The default is the URL of the XML Web service to which the attribute is applied.

Examples

The following example specifies a binding named RemoteBinding that is a member of the http://www.contoso.com/MyBinding namespace and defined at http://www.contoso.com/MyService.asmx?wsdl.

ASP.NET (C#)
<%@ 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";
    }
}

Applies to

Producto Versiones
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also