MetaData.ConvertTypesToSchemaToFile Method

Definition

Converts the specified types to XML schema, and writes it to a file.

Overloads

ConvertTypesToSchemaToFile(ServiceType[], SdlType, String)

Converts the specified service types to XML schema, and writes it to a file that is specified by name.

ConvertTypesToSchemaToFile(Type[], SdlType, String)

Converts the specified object types to XML schema, and writes it to a file that is specified by name.

ConvertTypesToSchemaToFile(ServiceType[], SdlType, String)

Converts the specified service types to XML schema, and writes it to a file that is specified by name.

C#
public static void ConvertTypesToSchemaToFile (System.Runtime.Remoting.MetadataServices.ServiceType[] types, System.Runtime.Remoting.MetadataServices.SdlType sdlType, string path);

Parameters

types
ServiceType[]

The ServiceType instances to convert to XML schema.

sdlType
SdlType

The type of service description language to use for the XML schema.

path
String

The path of the XML file.

Remarks

A ServiceType instance allows you to associate a URL with an object Type.

Note

If a file with the specified name already exists, it is overwritten.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

ConvertTypesToSchemaToFile(Type[], SdlType, String)

Converts the specified object types to XML schema, and writes it to a file that is specified by name.

C#
public static void ConvertTypesToSchemaToFile (Type[] types, System.Runtime.Remoting.MetadataServices.SdlType sdlType, string path);

Parameters

types
Type[]

The object types to convert to XML schema.

sdlType
SdlType

The type of service description language to use for the XML schema.

path
String

The path of the XML file.

Examples

The following code example demonstrates the use of the ConvertTypesToSchemaToFile method to write the schema definition of the specified types to a file.

C#
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");
   }
}

Remarks

Note

If a file with the specified name already exists, it is overwritten.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1