Compartir a través de


MetaData.ConvertTypesToSchemaToStream Método

Definición

Convierte los tipos especificados en un esquema XML, y lo escribe en una secuencia.

Sobrecargas

ConvertTypesToSchemaToStream(ServiceType[], SdlType, Stream)

Convierte los tipos de servicio especificados en un esquema XML, y lo escribe en una secuencia especificada.

ConvertTypesToSchemaToStream(Type[], SdlType, Stream)

Convierte los tipos de objetos especificados en un esquema XML, y lo escribe en la secuencia especificada.

ConvertTypesToSchemaToStream(ServiceType[], SdlType, Stream)

Convierte los tipos de servicio especificados en un esquema XML, y lo escribe en una secuencia especificada.

public:
 static void ConvertTypesToSchemaToStream(cli::array <System::Runtime::Remoting::MetadataServices::ServiceType ^> ^ serviceTypes, System::Runtime::Remoting::MetadataServices::SdlType sdlType, System::IO::Stream ^ outputStream);
public static void ConvertTypesToSchemaToStream (System.Runtime.Remoting.MetadataServices.ServiceType[] serviceTypes, System.Runtime.Remoting.MetadataServices.SdlType sdlType, System.IO.Stream outputStream);
static member ConvertTypesToSchemaToStream : System.Runtime.Remoting.MetadataServices.ServiceType[] * System.Runtime.Remoting.MetadataServices.SdlType * System.IO.Stream -> unit
Public Shared Sub ConvertTypesToSchemaToStream (serviceTypes As ServiceType(), sdlType As SdlType, outputStream As Stream)

Parámetros

serviceTypes
ServiceType[]

Instancias de ServiceType que se van a convertir en un esquema XML.

sdlType
SdlType

Tipo de lenguaje de descripción de servicios que se utiliza en el esquema XML.

outputStream
Stream

Stream en el que se escribe el esquema.

Comentarios

Una ServiceType instancia permite asociar una dirección URL a un objeto Type.

Se aplica a

ConvertTypesToSchemaToStream(Type[], SdlType, Stream)

Convierte los tipos de objetos especificados en un esquema XML, y lo escribe en la secuencia especificada.

public:
 static void ConvertTypesToSchemaToStream(cli::array <Type ^> ^ types, System::Runtime::Remoting::MetadataServices::SdlType sdlType, System::IO::Stream ^ outputStream);
public static void ConvertTypesToSchemaToStream (Type[] types, System.Runtime.Remoting.MetadataServices.SdlType sdlType, System.IO.Stream outputStream);
static member ConvertTypesToSchemaToStream : Type[] * System.Runtime.Remoting.MetadataServices.SdlType * System.IO.Stream -> unit
Public Shared Sub ConvertTypesToSchemaToStream (types As Type(), sdlType As SdlType, outputStream As Stream)

Parámetros

types
Type[]

Tipos de objeto que se van a convertir en un esquema XML.

sdlType
SdlType

Tipo de lenguaje de descripción de servicios que se utiliza en el esquema XML.

outputStream
Stream

Stream en el que se escribe el esquema.

Ejemplos

En el ejemplo de código siguiente se muestra el uso del método para escribir la definición de ConvertTypesToSchemaToStream esquema de los tipos especificados en una secuencia.

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

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

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 ] = i.GetType();
   types[ 3 ] = tc->GetType();
   FileStream^ fs = gcnew FileStream( "test.xml",FileMode::OpenOrCreate );
   MetaData::ConvertTypesToSchemaToStream( types, SdlType::Wsdl, fs );
   return 0;
}
using System;
using System.Runtime.Remoting.Metadata;
using System.Runtime.Remoting.MetadataServices;
using System.IO;

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();

      FileStream fs = new FileStream("test.xml", FileMode.OpenOrCreate);
      MetaData.ConvertTypesToSchemaToStream(types, SdlType.Wsdl, fs);
   }
}
Imports System.Runtime.Remoting.Metadata
Imports System.Runtime.Remoting.MetadataServices
Imports System.IO


Public Class Test
   
   Class TestClass
      Private [integer] As Integer
      Public dFloatingPoint As Double = 5.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()
      
      Dim fs As New FileStream("test.xml", FileMode.OpenOrCreate)
      MetaData.ConvertTypesToSchemaToStream(types, SdlType.Wsdl, fs)

   End Sub

End Class

Se aplica a