ServiceDescriptionImporter クラス
XML Web サービスのためのクライアント プロキシ クラスの生成方法を公開します。
この型のすべてのメンバの一覧については、ServiceDescriptionImporter メンバ を参照してください。
System.Object
System.Web.Services.Description.ServiceDescriptionImporter
Public Class ServiceDescriptionImporter
[C#]
public class ServiceDescriptionImporter
[C++]
public __gc class ServiceDescriptionImporter
[JScript]
public class ServiceDescriptionImporter
スレッドセーフ
この型の public static (Visual Basicでは Shared) のすべてのメンバは、マルチスレッド操作で安全に使用できます。インスタンスのメンバの場合は、スレッドセーフであるとは限りません。
使用例
Imports System
Imports System.Web.Services.Description
Imports System.CodeDom
Namespace MyServiceDescription
Class MyImporter
Public Shared Sub Main()
Try
Dim myServiceDescription As ServiceDescription = ServiceDescription.Read _
("Sample_VB.wsdl")
Dim myImporter As New ServiceDescriptionImporter()
' Set the protocol.
myImporter.ProtocolName = "Soap"
myImporter.AddServiceDescription(myServiceDescription, "", "")
Console.WriteLine("Style: " + myImporter.Style.ToString())
Dim myNamespace As New CodeNamespace(ServiceDescription.Namespace)
Dim myUnit As New CodeCompileUnit()
myUnit.Namespaces.Add(myNamespace)
Dim myWarning As ServiceDescriptionImportWarnings = myImporter.Import _
(myNamespace, myUnit)
Console.WriteLine("ServiceDescriptionImportWarnings value generated: " + _
myWarning.ToString())
' Get the XMLSchema related to the ServiceDescriptionImporter.
Dim mySchema As System.Xml.Serialization.XmlSchemas = myImporter.Schemas
Catch e As Exception
Console.WriteLine("Following exception was thrown: " + e.ToString())
End Try
End Sub 'Main
End Class 'MyImporter
End Namespace 'MyServiceDescription
[C#]
using System;
using System.Web.Services.Description;
using System.CodeDom;
namespace MyServiceDescription
{
class MyImporter
{
public static void Main()
{
try
{
ServiceDescription myServiceDescription =
ServiceDescription.Read("Sample_CS.wsdl");
ServiceDescriptionImporter myImporter =
new ServiceDescriptionImporter();
// Set the protocol.
myImporter.ProtocolName = "Soap";
myImporter.AddServiceDescription(myServiceDescription, "", "");
Console.WriteLine("Style: " + myImporter.Style.ToString());
CodeNamespace myNamespace =
new CodeNamespace(ServiceDescription.Namespace);
CodeCompileUnit myUnit = new CodeCompileUnit();
myUnit.Namespaces.Add(myNamespace);
ServiceDescriptionImportWarnings myWarning =
myImporter.Import(myNamespace, myUnit);
Console.WriteLine("ServiceDescriptionImportWarnings value generated: "
+ myWarning.ToString());
// Get the XMLSchema related to the ServiceDescriptionImporter.
System.Xml.Serialization.XmlSchemas mySchema = myImporter.Schemas;
}
catch (Exception e)
{
Console.WriteLine("Following exception was thrown: "
+ e.ToString());
}
}
}
}
[C++]
#using <mscorlib.dll>
#using <System.Web.Services.dll>
#using <System.dll>
#using <System.Xml.dll>
using namespace System;
using namespace System::Web::Services::Description;
using namespace System::CodeDom;
int main()
{
try
{
ServiceDescription* myServiceDescription =
ServiceDescription::Read(S"Sample_cpp.wsdl");
ServiceDescriptionImporter* myImporter = new ServiceDescriptionImporter();
// Set the protocol.
myImporter->ProtocolName = S"Soap";
myImporter->AddServiceDescription(myServiceDescription, S"", S"");
Console::WriteLine(S"Style: {0}",__box( myImporter->Style));
CodeNamespace* myNamespace = new CodeNamespace(ServiceDescription::Namespace);
CodeCompileUnit* myUnit = new CodeCompileUnit();
myUnit->Namespaces->Add(myNamespace);
ServiceDescriptionImportWarnings myWarning =
myImporter->Import(myNamespace, myUnit);
Console::WriteLine(S"ServiceDescriptionImportWarnings value generated: {0}",
__box( myWarning));
// Get the XMLSchema related to the ServiceDescriptionImporter.
myImporter->Schemas;
}
catch (Exception* e)
{
Console::WriteLine(S"Following exception was thrown: {0}", e);
}
}
[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
名前空間: System.Web.Services.Description
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ
アセンブリ: System.Web.Services (System.Web.Services.dll 内)
参照
ServiceDescriptionImporter メンバ | System.Web.Services.Description 名前空間