ContractReference 构造函数

定义

初始化 ContractReference 类的新实例。

重载

ContractReference()

使用默认值初始化 ContractReference 类的新实例。

ContractReference(String)

使用所提供的对服务说明的引用初始化 ContractReference 类的新实例。

ContractReference(String, String)

使用所提供的对某个服务说明和实现此服务说明的 XML Web services 的引用初始化 ContractReference 类的新实例。

ContractReference()

使用默认值初始化 ContractReference 类的新实例。

public:
 ContractReference();
public ContractReference ();
Public Sub New ()

示例

下面的代码示例创建 的新 ContractReference实例。

// Call the Constructor of ContractReference.
ContractReference^ myContractReference = gcnew ContractReference;
// Call the Constructor of ContractReference.
ContractReference myContractReference = new ContractReference();
' Call the Constructor of ContractReference.
Dim myContractReference As New ContractReference()

注解

使用此构造函数使用默认值创建和初始化 类的新实例 ContractReference

适用于

ContractReference(String)

使用所提供的对服务说明的引用初始化 ContractReference 类的新实例。

public:
 ContractReference(System::String ^ href);
public ContractReference (string href);
new System.Web.Services.Discovery.ContractReference : string -> System.Web.Services.Discovery.ContractReference
Public Sub New (href As String)

参数

href
String

服务说明的 URL。 初始化 Ref 属性值。

示例

// Create a ContractReference using a reference to a service description.
ContractReference^ myContractReference = gcnew ContractReference(
   "http://localhost/Service1::asmx?wsdl" );
// Create a ContractReference using a reference to a service description.
ContractReference myContractReference = new ContractReference
    ("http://localhost/Service1.asmx?wsdl");
'Create a ContractReference using a reference to a service description.
Dim myContractReference As _
    New ContractReference("http://localhost/Service1.asmx?wsdl")

注解

使用此构造函数可以使用指定的引用名称创建和初始化 类的新实例 ContractReference

下表显示了 实例 ContractReference的初始属性值。

属性 初始值
Ref href表示引用名称的参数。

适用于

ContractReference(String, String)

使用所提供的对某个服务说明和实现此服务说明的 XML Web services 的引用初始化 ContractReference 类的新实例。

public:
 ContractReference(System::String ^ href, System::String ^ docRef);
public ContractReference (string href, string docRef);
new System.Web.Services.Discovery.ContractReference : string * string -> System.Web.Services.Discovery.ContractReference
Public Sub New (href As String, docRef As String)

参数

href
String

服务说明的 URL。 初始化 Ref 属性值。

docRef
String

href 处实现服务说明的 XML Web services 的 URL。 初始化 DocRef 属性值。

示例

// Create a ContractReference using a service description and
// an XML Web service.
ContractReference^ myContractReference = gcnew ContractReference(
   "http://localhost/Service1::asmx?wsdl","http://localhost/Service1::asmx" );
// Create a ContractReference using a service description and
// an XML Web service.
ContractReference myContractReference = new ContractReference
    ("http://localhost/Service1.asmx?wsdl",
    "http://localhost/Service1.asmx");
' Create a ContractReference using a service description 
' and an XML Web service.
Dim myContractReference As New ContractReference  _
    ("http://localhost/Service1.asmx?wsdl", _
     "http://localhost/Service1.asmx")

注解

使用此构造函数使用指定的引用名称和 docRef创建和初始化 类的新实例ContractReference

下表显示了 实例 ContractReference的初始属性值。

属性 初始值
Ref href表示引用名称的参数。
DocRef 表示 docRef DocRef 的参数。

适用于