MetaData.ConvertTypesToSchemaToFile Metodo

Definizione

Converte i tipi specificati in uno schema XML e scrive lo schema in un file.Converts the specified types to XML schema, and writes it to a file.

Overload

ConvertTypesToSchemaToFile(ServiceType[], SdlType, String)

Converte i tipi di servizi specificati in uno schema XML e scrive lo schema in un file specificato in base al nome.Converts the specified service types to XML schema, and writes it to a file that is specified by name.

ConvertTypesToSchemaToFile(Type[], SdlType, String)

Converte i tipi di oggetto specificati in uno schema XML e scrive lo schema in un file specificato in base al nome.Converts the specified object types to XML schema, and writes it to a file that is specified by name.

ConvertTypesToSchemaToFile(ServiceType[], SdlType, String)

Converte i tipi di servizi specificati in uno schema XML e scrive lo schema in un file specificato in base al nome.Converts the specified service types to XML schema, and writes it to a file that is specified by name.

public:
 static void ConvertTypesToSchemaToFile(cli::array <System::Runtime::Remoting::MetadataServices::ServiceType ^> ^ types, System::Runtime::Remoting::MetadataServices::SdlType sdlType, System::String ^ path);
public static void ConvertTypesToSchemaToFile (System.Runtime.Remoting.MetadataServices.ServiceType[] types, System.Runtime.Remoting.MetadataServices.SdlType sdlType, string path);
static member ConvertTypesToSchemaToFile : System.Runtime.Remoting.MetadataServices.ServiceType[] * System.Runtime.Remoting.MetadataServices.SdlType * string -> unit

Parametri

types
ServiceType[]

Istanze dell'oggetto ServiceType da convertire in uno schema XML.The ServiceType instances to convert to XML schema.

sdlType
SdlType

Tipo di linguaggio di descrizione dei servizi da utilizzare per lo schema XML.The type of service description language to use for the XML schema.

path
String

Percorso del file XML.The path of the XML file.

Commenti

Un' ServiceType istanza di consente di associare un URL a un oggetto Type.A ServiceType instance allows you to associate a URL with an object Type.

Nota

Se un file con il nome specificato esiste già, verrà sovrascritto.If a file with the specified name already exists, it is overwritten.

ConvertTypesToSchemaToFile(Type[], SdlType, String)

Converte i tipi di oggetto specificati in uno schema XML e scrive lo schema in un file specificato in base al nome.Converts the specified object types to XML schema, and writes it to a file that is specified by name.

public:
 static void ConvertTypesToSchemaToFile(cli::array <Type ^> ^ types, System::Runtime::Remoting::MetadataServices::SdlType sdlType, System::String ^ path);
public static void ConvertTypesToSchemaToFile (Type[] types, System.Runtime.Remoting.MetadataServices.SdlType sdlType, string path);
static member ConvertTypesToSchemaToFile : Type[] * System.Runtime.Remoting.MetadataServices.SdlType * string -> unit

Parametri

types
Type[]

Tipi di oggetti da convertire in uno schema XML.The object types to convert to XML schema.

sdlType
SdlType

Tipo di linguaggio di descrizione dei servizi da utilizzare per lo schema XML.The type of service description language to use for the XML schema.

path
String

Percorso del file XML.The path of the XML file.

Esempi

Nell'esempio di codice riportato di seguito viene illustrato ConvertTypesToSchemaToFile l'utilizzo del metodo per scrivere la definizione dello schema dei tipi specificati in un file.The following code example demonstrates the use of the ConvertTypesToSchemaToFile method to write the schema definition of the specified types to a file.

#using <system.dll>
#using <system.runtime.remoting.dll>

using namespace System;
using namespace System::Runtime::Remoting::Metadata;
using namespace System::Runtime::Remoting::MetadataServices;

ref class TestClass
{
private:
   int integer;

public:
   static const double dFloatingPoint = 5.1999;

   property int Int
   {
      int get()
      {
         return integer;
      }
      void set( int value )
      {
         integer = value;
      }
   }
   void Print()
   {
      Console::WriteLine( "The double is equal to {0}.", dFloatingPoint );
   }
};

int main()
{
   array<Type^>^types = gcnew array<Type^>(4);
   String^ s = "a";
   int i = -5;
   double d = 3.1415;
   TestClass^ tc = gcnew TestClass;
   types[ 0 ] = s->GetType();
   types[ 1 ] = i.GetType();
   types[ 2 ] = d.GetType();
   types[ 3 ] = tc->GetType();
   MetaData::ConvertTypesToSchemaToFile( types, SdlType::Wsdl, "test.xml" );
   return 0;
}
using System;
using System.Runtime.Remoting.Metadata;
using System.Runtime.Remoting.MetadataServices;

public class Test {

   class TestClass {
      int integer;
      public double dFloatingPoint = 5.1999;

      public int Int {
         get { return integer; }
         set { integer = value; }
      }

      public void Print () {
         Console.WriteLine("The double is equal to {0}.", dFloatingPoint);
      }
   }
   

   public static void Main() {

      Type[] types = new Type[4];

      String s = "a";
      int i = -5;
      double d = 3.1415;
      TestClass tc = new TestClass();

      types[0] = s.GetType();
      types[1] = i.GetType();
      types[2] = d.GetType();
      types[3] = tc.GetType();

      MetaData.ConvertTypesToSchemaToFile(types, SdlType.Wsdl, "test.xml");
   }
}
Imports System.Runtime.Remoting.Metadata
Imports System.Runtime.Remoting.MetadataServices


Public Class Test
   
   Class TestClass
      Private [integer] As Integer
      Public dFloatingPoint As Double = 3.1999
      
      Public Property Int() As Integer
         Get
            Return [integer]
         End Get
         Set
            [integer] = value
         End Set
      End Property
       
      Public Sub Print()
         Console.WriteLine("The double is equal to {0}.", dFloatingPoint)
      End Sub
   End Class
  
   
   Public Shared Sub Main()
      Dim types(4) As Type
      
      Dim s As [String] = "a"
      Dim i As Integer = - 5
      Dim d As Double = 3.1415
      Dim tc As New TestClass()
      
      types(0) = s.GetType()
      types(1) = i.GetType()
      types(2) = d.GetType()
      types(3) = tc.GetType()
      
      MetaData.ConvertTypesToSchemaToFile(types, SdlType.Wsdl, "test.xml")
   End Sub

End Class

Commenti

Nota

Se un file con il nome specificato esiste già, verrà sovrascritto.If a file with the specified name already exists, it is overwritten.

Si applica a