XmlSecureResolver.GetEntity(Uri, String, Type) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Maps a URI to an object that contains the actual resource. This method temporarily sets the PermissionSet created in the constructor by calling PermitOnly() before calling GetEntity
on the underlying XmlResolver to open the resource.
public:
override System::Object ^ GetEntity(Uri ^ absoluteUri, System::String ^ role, Type ^ ofObjectToReturn);
public override object? GetEntity (Uri absoluteUri, string? role, Type? ofObjectToReturn);
public override object GetEntity (Uri absoluteUri, string role, Type ofObjectToReturn);
override this.GetEntity : Uri * string * Type -> obj
Public Overrides Function GetEntity (absoluteUri As Uri, role As String, ofObjectToReturn As Type) As Object
Parameters
- absoluteUri
- Uri
The URI that is returned from ResolveUri(Uri, String).
- role
- String
Currently not used.
- ofObjectToReturn
- Type
The type of object to return. The current version only returns Stream objects.
Returns
The stream returned by calling GetEntity
on the underlying XmlResolver. If a type other than Stream is specified, the method returns null
.
Exceptions
The specified URI is not an absolute URI.
absoluteUri
is null
.
There is a run-time error (for example, an interrupted server connection).
Remarks
Important
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.