次の方法で共有


WebServiceBindingAttribute.Namespace プロパティ

バインディングに関連付けられている名前空間を取得または設定します。

Public Property Namespace As String
[C#]
public string Namespace {get; set;}
[C++]
public: __property String* get_Namespace();public: __property void set_Namespace(String*);
[JScript]
public function get Namespace() : String;public function set Namespace(String);

プロパティ値

バインディングの名前空間。既定値は http://tempuri.org/です。

使用例

[Visual Basic, C#] https://www.contoso.com/MyBinding 名前空間のメンバであり、 BindingSample XML Web サービスで定義されている、 LocalBindingNonDefaultNamespace という名前のバインディングを指定する例を次に示します。

 
' Binding is defined in this XML Web service, but it is not a part of the default namespace.
<WebServiceBinding(Name := "LocalBindingNonDefaultNamespace", _
    Namespace := "https://www.contoso.com/MyBinding")> _
Public Class BindingSample   
    
    <SoapDocumentMethod(Binding := "LocalBindingNonDefaultNamespace"), _
        WebMethod()> _
    Public Function LocalBindingNonDefaultNamespaceMethod() As String
        
        Return "Member of binding defined in this XML Web service, but a part " & _
               "of a different namespace"
    End Function
End Class
 

[C#] 
// Binding is defined in this XML Web service, but it is not a part of the default namespace.
 [ WebServiceBinding(Name="LocalBindingNonDefaultNamespace",
 Namespace="https://www.contoso.com/MyBinding")]
 public class BindingSample  {

      [ SoapDocumentMethod(Binding="LocalBindingNonDefaultNamespace")] 
      [ WebMethod() ]
      public string LocalBindingNonDefaultNamespaceMethod() {
              return "Member of binding defined in this XML Web service, but a part of a different namespace";
      }
 }
 

[C++, JScript] C++ および JScript のサンプルはありません。Visual Basic および C# のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET

参照

WebServiceBindingAttribute クラス | WebServiceBindingAttribute メンバ | System.Web.Services 名前空間