ServiceDescription.Imports-Eigenschaft
Ruft die Auflistung von Import-Elementen ab, die in der ServiceDescription enthalten sind.
Namespace: System.Web.Services.Description
Assembly: System.Web.Services (in system.web.services.dll)
Syntax
'Declaration
Public ReadOnly Property Imports As ImportCollection
'Usage
Dim instance As ServiceDescription
Dim value As ImportCollection
value = instance.Imports
public ImportCollection Imports { get; }
public:
property ImportCollection^ Imports {
ImportCollection^ get ();
}
/** @property */
public ImportCollection get_Imports ()
public function get Imports () : ImportCollection
Eigenschaftenwert
Eine ImportCollection.
Hinweise
Die von dieser Eigenschaft zurückgegebene ImportCollection entspricht der Liste von import-Elementen, die vom WSDL-definitions-Stammelement (Web Services Description Language) eingeschlossen sind. Weitere Informationen zu WSDL finden Sie in der Spezifikation unter http://www.w3.org/TR/wsdl/.
Beispiel
Dim myServiceDescription As New ServiceDescription()
myServiceDescription = _
ServiceDescription.Read("ServiceDescription_Imports_Input_VB.wsdl")
Dim myImportCollection As ImportCollection = myServiceDescription.Imports
' Create an Import.
Dim myImport As New Import()
myImport.Namespace = myServiceDescription.TargetNamespace
' Set the location for the Import.
myImport.Location = "https://www.contoso.com/"
myImportCollection.Add(myImport)
myServiceDescription.Write("ServiceDescription_Imports_Output_VB.wsdl")
myImportCollection.Clear()
myServiceDescription = _
ServiceDescription.Read("ServiceDescription_Imports_Output_VB.wsdl")
myImportCollection = myServiceDescription.Imports
Console.WriteLine( _
"The Import elements added to the ImportCollection are: ")
Dim i As Integer
For i = 0 To myImportCollection.Count - 1
Console.WriteLine((i + 1).ToString() & ". " & _
myImportCollection(i).Location)
Next i
ServiceDescription myServiceDescription = new ServiceDescription();
myServiceDescription =
ServiceDescription.Read("ServiceDescription_Imports_Input_CS.wsdl");
ImportCollection myImportCollection = myServiceDescription.Imports;
// Create an Import.
Import myImport = new Import();
myImport.Namespace = myServiceDescription.TargetNamespace;
// Set the location for the Import.
myImport.Location = "https://www.contoso.com/";
myImportCollection.Add(myImport);
myServiceDescription.Write("ServiceDescription_Imports_Output_CS.wsdl");
myImportCollection.Clear();
myServiceDescription =
ServiceDescription.Read("ServiceDescription_Imports_Output_CS.wsdl");
myImportCollection = myServiceDescription.Imports;
Console.WriteLine(
"The Import elements added to the ImportCollection are: ");
for(int i = 0; i < myImportCollection.Count; i++)
{
Console.WriteLine((i+1) + ". " + myImportCollection[i].Location);
}
ServiceDescription^ myServiceDescription = gcnew ServiceDescription;
myServiceDescription = ServiceDescription::Read( "ServiceDescription_Imports_Input_CS.wsdl" );
ImportCollection^ myImportCollection = myServiceDescription->Imports;
// Create an Import.
Import^ myImport = gcnew Import;
myImport->Namespace = myServiceDescription->TargetNamespace;
// Set the location for the Import.
myImport->Location = "https://www.contoso.com/";
myImportCollection->Add( myImport );
myServiceDescription->Write( "ServiceDescription_Imports_Output_CS.wsdl" );
myImportCollection->Clear();
myServiceDescription = ServiceDescription::Read( "ServiceDescription_Imports_Output_CS.wsdl" );
myImportCollection = myServiceDescription->Imports;
Console::WriteLine( "The Import elements added to the ImportCollection are: " );
for ( int i = 0; i < myImportCollection->Count; i++ )
{
Console::WriteLine( "{0}. {1}", (i + 1), myImportCollection[ i ]->Location );
}
ServiceDescription myServiceDescription = new ServiceDescription();
myServiceDescription = ServiceDescription.Read(
"ServiceDescription_Imports_Input_JSL.wsdl");
ImportCollection myImportCollection =
myServiceDescription.get_Imports();
// Create an Import.
Import myImport = new Import();
myImport.set_Namespace(myServiceDescription.get_TargetNamespace());
// Set the location for the Import.
myImport.set_Location("https://www.contoso.com/");
myImportCollection.Add(myImport);
myServiceDescription.Write(
"ServiceDescription_Imports_Output_JSL.wsdl");
myImportCollection.Clear();
myServiceDescription = ServiceDescription.Read(
"ServiceDescription_Imports_Output_JSL.wsdl");
myImportCollection = myServiceDescription.get_Imports();
Console.WriteLine("The Import elements added to the " +
" ImportCollection are: ");
for (int i = 0; i < myImportCollection.get_Count(); i++) {
Console.WriteLine(i + 1 + ". "
+ myImportCollection.get_Item(i).get_Location());
}
Plattformen
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.
Versionsinformationen
.NET Framework
Unterstützt in: 2.0, 1.1, 1.0
Siehe auch
Referenz
ServiceDescription-Klasse
ServiceDescription-Member
System.Web.Services.Description-Namespace