This documentation is archived and is not being maintained.

ServiceDescription::Types Property

Gets or sets the Types contained by the ServiceDescription.

Namespace:  System.Web.Services.Description
Assembly:  System.Web.Services (in System.Web.Services.dll)

public:
property Types^ Types {
	Types^ get ();
	void set (Types^ value);
}

Property Value

Type: System.Web.Services.Description::Types
A Types instance that represents the data types of both the parameters and return values of the methods exposed by the XML Web service.

The Types instance returned by this property corresponds to the list of types elements enclosed by the Web Services Description Language (WSDL) definitions root element. For more information about WSDL, see the specification at http://www.w3.org/TR/wsdl/.

myServiceDescription->Types->Schemas->Remove( myServiceDescription->Types->Schemas[ 0 ] );
XmlSchema^ myXmlSchema = gcnew XmlSchema;
myXmlSchema->AttributeFormDefault = XmlSchemaForm::Qualified;
myXmlSchema->ElementFormDefault = XmlSchemaForm::Qualified;
myXmlSchema->TargetNamespace = myServiceDescription->TargetNamespace;
XmlSchemaElement^ myXmlElement1 = gcnew XmlSchemaElement;
myXmlElement1->Name = "Add";
XmlSchemaComplexType^ myXmlSchemaComplexType = gcnew XmlSchemaComplexType;
XmlSchemaSequence^ myXmlSchemaSequence = gcnew XmlSchemaSequence;
myXmlSchemaSequence->Items->Add( CreateComplexTypeXmlElement( "1", "1", "a", gcnew XmlQualifiedName( "s:float" ) ) );
myXmlSchemaSequence->Items->Add( CreateComplexTypeXmlElement( "1", "1", "b", gcnew XmlQualifiedName( "s:float" ) ) );
myXmlSchemaComplexType->Particle = myXmlSchemaSequence;
myXmlElement1->SchemaType = myXmlSchemaComplexType;
myXmlSchema->Items->Add( myXmlElement1 );
XmlSchemaElement^ myXmlElement2 = gcnew XmlSchemaElement;
myXmlElement2->Name = "AddResponse";
myXmlSchemaComplexType = gcnew XmlSchemaComplexType;
myXmlSchemaSequence = gcnew XmlSchemaSequence;
myXmlSchemaSequence->Items->Add( CreateComplexTypeXmlElement( "1", "1", "AddResult", gcnew XmlQualifiedName( "s:float" ) ) );
myXmlSchemaComplexType->Particle = myXmlSchemaSequence;
myXmlElement2->SchemaType = myXmlSchemaComplexType;
myXmlSchema->Items->Add( myXmlElement2 );
XmlSchemaElement^ myXmlElement3 = gcnew XmlSchemaElement;
myXmlElement3->Name = "Subtract";
myXmlSchemaComplexType = gcnew XmlSchemaComplexType;
myXmlSchemaSequence = gcnew XmlSchemaSequence;
myXmlSchemaSequence->Items->Add( CreateComplexTypeXmlElement( "1", "1", "a", gcnew XmlQualifiedName( "s:float" ) ) );
myXmlSchemaSequence->Items->Add( CreateComplexTypeXmlElement( "1", "1", "b", gcnew XmlQualifiedName( "s:float" ) ) );
myXmlSchemaComplexType->Particle = myXmlSchemaSequence;
myXmlElement3->SchemaType = myXmlSchemaComplexType;
myXmlSchema->Items->Add( myXmlElement3 );
XmlSchemaElement^ myXmlElement4 = gcnew XmlSchemaElement;
myXmlElement4->Name = "SubtractResponse";
myXmlSchemaComplexType = gcnew XmlSchemaComplexType;
myXmlSchemaSequence = gcnew XmlSchemaSequence;
myXmlSchemaSequence->Items->Add( CreateComplexTypeXmlElement( "1", "1", "SubtractResult", gcnew XmlQualifiedName( "s:int" ) ) );
myXmlSchemaComplexType->Particle = myXmlSchemaSequence;
myXmlElement4->SchemaType = myXmlSchemaComplexType;
myXmlSchema->Items->Add( myXmlElement4 );

// Add the schemas to the Types property of the ServiceDescription.
myServiceDescription->Types->Schemas->Add( myXmlSchema );
myServiceDescription->Types->Schemas->Remove(
   myServiceDescription->Types->Schemas->Item[0]);
XmlSchema* myXmlSchema = new XmlSchema();
myXmlSchema->AttributeFormDefault = XmlSchemaForm::Qualified;
myXmlSchema->ElementFormDefault = XmlSchemaForm::Qualified;
myXmlSchema->TargetNamespace = myServiceDescription->TargetNamespace;

XmlSchemaElement* myXmlElement1 = new XmlSchemaElement();
myXmlElement1->Name=S"Add";

XmlSchemaComplexType* myXmlSchemaComplexType = 
   new XmlSchemaComplexType();
XmlSchemaSequence* myXmlSchemaSequence = new XmlSchemaSequence();
myXmlSchemaSequence->Items->Add(CreateComplexTypeXmlElement(
   S"1", S"1", S"a", new XmlQualifiedName(S"s:float")));

myXmlSchemaSequence->Items->Add(CreateComplexTypeXmlElement(
   S"1", S"1", S"b", new XmlQualifiedName(S"s:float")));

myXmlSchemaComplexType->Particle = myXmlSchemaSequence;
myXmlElement1->SchemaType = myXmlSchemaComplexType;
myXmlSchema->Items->Add(myXmlElement1);

XmlSchemaElement* myXmlElement2 = new XmlSchemaElement();
myXmlElement2->Name = S"AddResponse";
myXmlSchemaComplexType = new XmlSchemaComplexType();
myXmlSchemaSequence = new XmlSchemaSequence();
myXmlSchemaSequence->Items->Add(CreateComplexTypeXmlElement(
   S"1", S"1", S"AddResult", new XmlQualifiedName(S"s:float")));

myXmlSchemaComplexType->Particle = myXmlSchemaSequence;
myXmlElement2->SchemaType=myXmlSchemaComplexType;
myXmlSchema->Items->Add(myXmlElement2);

XmlSchemaElement* myXmlElement3 = new XmlSchemaElement();
myXmlElement3->Name=S"Subtract";
myXmlSchemaComplexType = new XmlSchemaComplexType();
myXmlSchemaSequence = new XmlSchemaSequence();
myXmlSchemaSequence->Items->Add(CreateComplexTypeXmlElement(
   S"1", S"1", S"a", new XmlQualifiedName(S"s:float")));

myXmlSchemaSequence->Items->Add(CreateComplexTypeXmlElement(
   S"1", S"1", S"b", new XmlQualifiedName(S"s:float")));

myXmlSchemaComplexType->Particle = myXmlSchemaSequence;
myXmlElement3->SchemaType=myXmlSchemaComplexType;
myXmlSchema->Items->Add(myXmlElement3);

XmlSchemaElement* myXmlElement4 = new XmlSchemaElement();
myXmlElement4->Name=S"SubtractResponse";
myXmlSchemaComplexType = new XmlSchemaComplexType();
myXmlSchemaSequence = new XmlSchemaSequence();
myXmlSchemaSequence->Items->Add(CreateComplexTypeXmlElement(
   S"1", S"1", S"SubtractResult", new XmlQualifiedName(S"s:int")));

myXmlSchemaComplexType->Particle = myXmlSchemaSequence;
myXmlElement4->SchemaType = myXmlSchemaComplexType;
myXmlSchema->Items->Add(myXmlElement4);

// Add the schemas to the Types property of the ServiceDescription.
myServiceDescription->Types->Schemas->Add(myXmlSchema);

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0
Show: