WebServiceBindingAttribute.Location Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the location where the binding is defined.
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
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
.
<%@ 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>
Applies to
See also
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET