ServiceDescription.Types Property
.NET Framework 2.0
Gets or sets the Types contained by the ServiceDescription.
Namespace: System.Web.Services.Description
Assembly: System.Web.Services (in system.web.services.dll)
Assembly: System.Web.Services (in system.web.services.dll)
/** @property */ public Types get_Types () /** @property */ public void set_Types (Types value)
public function get Types () : Types public function set Types (value : Types)
Not applicable.
Property Value
A Types instance that represents the data types of both the parameters and return values of the methods exposed by the XML Web service.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.get_Types().get_Schemas().Remove(
myServiceDescription.get_Types().get_Schemas().get_Item(0));
XmlSchema myXmlSchema = new XmlSchema();
myXmlSchema.set_AttributeFormDefault(XmlSchemaForm.Qualified);
myXmlSchema.set_ElementFormDefault(XmlSchemaForm.Qualified);
myXmlSchema.set_TargetNamespace(myServiceDescription.
get_TargetNamespace());
XmlSchemaElement myXmlElement1 = new XmlSchemaElement();
myXmlElement1.set_Name("Add");
XmlSchemaComplexType myXmlSchemaComplexType
= new XmlSchemaComplexType();
XmlSchemaSequence myXmlSchemaSequence = new XmlSchemaSequence();
myXmlSchemaSequence.get_Items().Add(CreateComplexTypeXmlElement(
"1", "1", "a", new XmlQualifiedName("s:float")));
myXmlSchemaSequence.get_Items().Add(CreateComplexTypeXmlElement(
"1", "1", "b", new XmlQualifiedName("s:float")));
myXmlSchemaComplexType.set_Particle(myXmlSchemaSequence);
myXmlElement1.set_SchemaType(myXmlSchemaComplexType);
myXmlSchema.get_Items().Add(myXmlElement1);
XmlSchemaElement myXmlElement2 = new XmlSchemaElement();
myXmlElement2.set_Name("AddResponse");
myXmlSchemaComplexType = new XmlSchemaComplexType();
myXmlSchemaSequence = new XmlSchemaSequence();
myXmlSchemaSequence.get_Items().Add(CreateComplexTypeXmlElement(
"1", "1", "AddResult", new XmlQualifiedName("s:float")));
myXmlSchemaComplexType.set_Particle(myXmlSchemaSequence);
myXmlElement2.set_SchemaType(myXmlSchemaComplexType);
myXmlSchema.get_Items().Add(myXmlElement2);
XmlSchemaElement myXmlElement3 = new XmlSchemaElement();
myXmlElement3.set_Name("Subtract");
myXmlSchemaComplexType = new XmlSchemaComplexType();
myXmlSchemaSequence = new XmlSchemaSequence();
myXmlSchemaSequence.get_Items().Add(CreateComplexTypeXmlElement(
"1", "1", "a", new XmlQualifiedName("s:float")));
myXmlSchemaSequence.get_Items().Add(CreateComplexTypeXmlElement(
"1", "1", "b", new XmlQualifiedName("s:float")));
myXmlSchemaComplexType.set_Particle(myXmlSchemaSequence);
myXmlElement3.set_SchemaType(myXmlSchemaComplexType);
myXmlSchema.get_Items().Add(myXmlElement3);
XmlSchemaElement myXmlElement4 = new XmlSchemaElement();
myXmlElement4.set_Name("SubtractResponse");
myXmlSchemaComplexType = new XmlSchemaComplexType();
myXmlSchemaSequence = new XmlSchemaSequence();
myXmlSchemaSequence.get_Items().Add(CreateComplexTypeXmlElement(
"1", "1", "SubtractResult", new XmlQualifiedName("s:int")));
myXmlSchemaComplexType.set_Particle(myXmlSchemaSequence);
myXmlElement4.set_SchemaType(myXmlSchemaComplexType);
myXmlSchema.get_Items().Add(myXmlElement4);
// Add the schemas to the Types property of the ServiceDescription.
myServiceDescription.get_Types().get_Schemas().Add(myXmlSchema);
Windows 98, Windows Server 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
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Community Additions
ADD
Show: