ServiceDescriptionImporter.Import メソッド

指定した名前空間から ServiceDescription をインポートし、クライアント プロキシ クラスのコードを生成します。

Public Function Import( _
   ByVal codeNamespace As CodeNamespace, _   ByVal codeCompileUnit As CodeCompileUnit _) As ServiceDescriptionImportWarnings
[C#]
public ServiceDescriptionImportWarnings Import(CodeNamespacecodeNamespace,CodeCompileUnitcodeCompileUnit);
[C++]
public: ServiceDescriptionImportWarnings Import(CodeNamespace* codeNamespace,CodeCompileUnit* codeCompileUnit);
[JScript]
public function Import(
   codeNamespace : CodeNamespace,codeCompileUnit : CodeCompileUnit) : ServiceDescriptionImportWarnings;

パラメータ

戻り値

ServiceDescriptionImportWarnings 値の 1 つ。

使用例

 
Dim myServiceDescription As ServiceDescription = _
                           ServiceDescription.Read("Sample_vb.wsdl")
Dim myImporter As New ServiceDescriptionImporter()
' Set the protocol for which operation tag in .wsdl file is changed.
myImporter.ProtocolName = "Soap"
myImporter.AddServiceDescription(myServiceDescription, "", "")

Dim myNamespace As New CodeNamespace(ServiceDescription.Namespace)
Dim myUnit As New CodeCompileUnit()

Dim myCodeCollection As CodeNamespaceCollection = myUnit.Namespaces
myCodeCollection.Add(myNamespace)

Dim myWarning As ServiceDescriptionImportWarnings = _
                              myImporter.Import(myNamespace, myUnit)
Console.WriteLine("ServiceDescriptionImportWarnings value generated: " + _
                                                myWarning.ToString())

[C#] 
ServiceDescription myServiceDescription = 
               ServiceDescription.Read("Sample_CS.wsdl");
ServiceDescriptionImporter myImporter = 
               new ServiceDescriptionImporter();
// Set the protocol for which operation tag in .wsdl file is changed.
myImporter.ProtocolName = "Soap";
myImporter.AddServiceDescription(myServiceDescription, "", "");

CodeNamespace myNamespace = 
            new CodeNamespace(ServiceDescription.Namespace);
CodeCompileUnit myUnit = new CodeCompileUnit();

CodeNamespaceCollection myCodeCollection = myUnit.Namespaces;
myCodeCollection.Add(myNamespace);
ServiceDescriptionImportWarnings myWarning = 
   myImporter.Import(myNamespace, myUnit);
Console.WriteLine("ServiceDescriptionImportWarnings value generated: " 
   + myWarning.ToString());

[C++] 
ServiceDescription* myServiceDescription =
   ServiceDescription::Read(S"Sample_cpp.wsdl");
ServiceDescriptionImporter* myImporter = new ServiceDescriptionImporter();
// Set the protocol for which operation tag in .wsdl file is changed.
myImporter->ProtocolName = S"Soap";
myImporter->AddServiceDescription(myServiceDescription, S"", S"");

CodeNamespace* myNamespace = new CodeNamespace(ServiceDescription::Namespace);
CodeCompileUnit* myUnit = new CodeCompileUnit();

CodeNamespaceCollection* myCodeCollection = myUnit->Namespaces;
myCodeCollection->Add(myNamespace);
ServiceDescriptionImportWarnings myWarning =
   myImporter->Import(myNamespace, myUnit);
Console::WriteLine(S"ServiceDescriptionImportWarnings value generated: {0}",
   __box( myWarning));

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

必要条件

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

参照

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