XmlSecureResolver::GetEntity Method (Uri^, String^, Type^)
Maps a URI to an object that contains the actual resource. This method temporarily sets the System.Security::PermissionSet created in the constructor by calling PermissionSet::PermitOnly before calling GetEntity on the underlying XmlResolver to open the resource.
Assembly: System.Xml (in System.Xml.dll)
public: virtual Object^ GetEntity( Uri^ absoluteUri, String^ role, Type^ ofObjectToReturn ) override
Parameters
- absoluteUri
-
Type:
System::Uri^
The URI that is returned from ResolveUri.
- role
-
Type:
System::String^
Currently not used.
- ofObjectToReturn
-
Type:
System::Type^
The type of object to return. The current version only returns Stream objects.
Return Value
Type: System::Object^The stream returned by calling GetEntity on the underlying XmlResolver. If a type other than Stream is specified, the method returns null.
| Exception | Condition |
|---|---|
| XmlException | ofObjectToReturn is neither null nor a Stream type. |
| UriFormatException | The specified URI is not an absolute URI. |
| NullReferenceException | absoluteUri is null. |
| Exception | There is a runtime error (for example, an interrupted server connection). |
Security Note
|
|---|
Your application can mitigate memory denial of service threats to the GetEntity method by implementing an IStream that limits the number of bytes read. This helps guard against situations where malicious code attempts to pass an infinite stream of bytes to the GetEntity method. |
Available since 1.1
