nedcomp hosting homepage

Producten en Diensten
Dedicated servers
Datacenter informatie
Partners, resellers
Helpdesk informatie
Technische docs, tools
Support homepage
ASP componenten
Praktische ASP, ASP.NET
Visual route server
Whois (domein gegevens)
Software documentatie
Whitepapers
Zoeken
Nedcomp / algemeen

Zoeken
 

Copyright © Nedcomp Hosting
Telefoon nr :   +31 184 670111
Fax nummer :   +31 184 631384
E-mailadres :   info@nedcomp.nl
 

.NET Framework Class Library  

SchemaReference.Ref Property

Gets or sets the URL to the referenced XSD schema.

[Visual Basic]
Public Property Ref As String
[C#]
public string Ref {get; set;}
[C++]
public: __property String* get_Ref();
public: __property void set_Ref(String*);
[JScript]
public function get Ref() : String;
public function set Ref(String);

Property Value

The URL for the referenced XSD schema. The default value is Empty.

Remarks

In a discovery document, a reference to an XSD schema is contained within a schemaRef XML element. The schemaRef XML element has a ref attribute, which is the URL for the referenced XSD schema. The Ref property represents the value of the ref attribute.

Example

[Visual Basic] 

         ' Reference the schema document.
         Dim myStringUrl As String = "c:\\Inetpub\\wwwroot\\dataservice.xsd"
         Dim myXmlSchema As XmlSchema

         ' Create the client protocol.
         Dim myDiscoveryClientProtocol As DiscoveryClientProtocol = _
             New DiscoveryClientProtocol()
         myDiscoveryClientProtocol.Credentials = _
             CredentialCache.DefaultCredentials

         ' Create a schema reference.
         Dim mySchemaReferenceNoParam As SchemaReference = New SchemaReference()

         Dim mySchemaReference As SchemaReference = _
             New SchemaReference(myStringUrl)

         ' Set the client protocol.
         mySchemaReference.ClientProtocol = myDiscoveryClientProtocol

         ' Access the default file name associated with the schema reference.
         Console.WriteLine("Default filename is : " & _
             mySchemaReference.DefaultFilename)

         ' Access the namespace associated with schema reference class.
         Console.WriteLine("Namespace is : " & SchemaReference.Namespace)

         Dim myStream As FileStream = _
             New FileStream(myStringUrl, FileMode.OpenOrCreate)

         ' Read the document in a stream.
         mySchemaReference.ReadDocument(myStream)

         ' Get the schema of the referenced document.
         myXmlSchema = mySchemaReference.Schema

         Console.WriteLine("Reference is : " & mySchemaReference.Ref)

         Console.WriteLine("Target namespace (default empty) is : " & _
             mySchemaReference.TargetNamespace)

         Console.WriteLine("URL is : " & mySchemaReference.Url)

         ' Write the document in the stream.
         mySchemaReference.WriteDocument(myXmlSchema, myStream)

         myStream.Close()
         mySchemaReference = Nothing

[C#] 

         // Reference the schema document.
         string myStringUrl = "c:\\Inetpub\\wwwroot\\dataservice.xsd";
         XmlSchema myXmlSchema;

         // Create the client protocol.
         DiscoveryClientProtocol myDiscoveryClientProtocol = 
             new DiscoveryClientProtocol();
         myDiscoveryClientProtocol.Credentials = 
             CredentialCache.DefaultCredentials;
         
         //  Create a schema reference.
         SchemaReference mySchemaReferenceNoParam = new SchemaReference();
         
         SchemaReference mySchemaReference = new SchemaReference(myStringUrl);
                  
         // Set the client protocol.
         mySchemaReference.ClientProtocol = myDiscoveryClientProtocol;

         // Access the default file name associated with the schema reference.
         Console.WriteLine("Default filename is : " + 
             mySchemaReference.DefaultFilename);
         
         // Access the namespace associated with schema reference class.
         Console.WriteLine("Namespace is : " + SchemaReference.Namespace);
         
         FileStream myStream = 
             new FileStream(myStringUrl,FileMode.OpenOrCreate); 
         
         // Read the document in a stream.
         mySchemaReference.ReadDocument(myStream);
         
         // Get the schema of referenced document.
         myXmlSchema = mySchemaReference.Schema;
         
         Console.WriteLine("Reference is : " + mySchemaReference.Ref);      
         
         Console.WriteLine("Target namespace (default empty) is : " + 
             mySchemaReference.TargetNamespace);

         Console.WriteLine("URL is : " + mySchemaReference.Url);
         
         // Write the document in the stream.
         mySchemaReference.WriteDocument(myXmlSchema,myStream);

         myStream.Close();
         mySchemaReference = null;


[C++] 
// Reference the schema document.
String* myStringUrl = S"c:\\Inetpub\\wwwroot\\dataservice.xsd";
XmlSchema* myXmlSchema;

// Create the client protocol.
DiscoveryClientProtocol* myDiscoveryClientProtocol =
   new DiscoveryClientProtocol();
myDiscoveryClientProtocol->Credentials =
   CredentialCache::DefaultCredentials;

//  Create a schema reference.
SchemaReference* mySchemaReferenceNoParam = new SchemaReference();

SchemaReference* mySchemaReference = new SchemaReference(myStringUrl);

// Set the client protocol.
mySchemaReference->ClientProtocol = myDiscoveryClientProtocol;

// Access the default file name associated with the schema reference.
Console::WriteLine(S"Default filename is : {0}",
   mySchemaReference->DefaultFilename);

// Access the namespace associated with schema reference class.
Console::WriteLine(S"Namespace is : {0}", SchemaReference::Namespace);

FileStream* myStream =
   new FileStream(myStringUrl, FileMode::OpenOrCreate);

// Read the document in a stream.
mySchemaReference->ReadDocument(myStream);

// Get the schema of referenced document.
myXmlSchema = mySchemaReference->Schema;

Console::WriteLine(S"Reference is : {0}", mySchemaReference->Ref);

Console::WriteLine(S"Target namespace (default empty) is : {0}",
   mySchemaReference->TargetNamespace);

Console::WriteLine(S"URL is : {0}", mySchemaReference->Url);

// Write the document in the stream.
mySchemaReference->WriteDocument(myXmlSchema, myStream);

myStream->Close();
mySchemaReference = 0;

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

SchemaReference Class | SchemaReference Members | System.Web.Services.Discovery Namespace