Skip to content

Xlink error - cannot deserialize a vendor provided XML files using some industry standard schemas. #563

@leus

Description

@leus

Problem

Using the following code:

 var serializer = new XmlSerializer(typeof(MESSAGE));
 var reader = XmlReader.Create(stream, new XmlReaderSettings { Async = true });
 var deserialized = await Task.Run(() => serializer.Deserialize(reader) as MESSAGE, cancellationToken);

I get the following exception:

System.InvalidOperationException : There was an error reflecting type 'SomeNamespace.MESSAGE'.
      ----> System.InvalidOperationException : There was an error reflecting property 'DEAL_SETS'.
      ----> System.InvalidOperationException : There was an error reflecting type 'SomeNamespace.DEAL_SETS'.
      ----> System.InvalidOperationException : There was an error reflecting property 'DEAL_SET'.
      ----> System.InvalidOperationException : There was an error reflecting type 'SomeNamespace.DEAL_SET'.
      ----> System.InvalidOperationException : There was an error reflecting property 'DEALS'.
      ----> System.InvalidOperationException : There was an error reflecting type 'SomeNamespace.DEALS'.
      ----> System.InvalidOperationException : There was an error reflecting property 'DEAL'.
      ----> System.InvalidOperationException : There was an error reflecting type 'SomeNamespace.DEAL'.
      ----> System.InvalidOperationException : There was an error reflecting property 'RELATIONSHIPS'.
      ----> System.InvalidOperationException : There was an error reflecting type 'SomeNamespace.RELATIONSHIPS'.
      ----> System.InvalidOperationException : There was an error reflecting property 'RELATIONSHIP'.
      ----> System.InvalidOperationException : There was an error reflecting type 'SomeNamespace.RELATIONSHIP'.
      ----> System.InvalidOperationException : There was an error reflecting property 'type'.
      ----> System.InvalidOperationException : The global XML attribute 'type' from namespace 'http://www.w3.org/1999/xlink' references distinct types SomeNamespace.MISMOresourceLink and SomeNamespace.MISMOarcLink. Use XML attributes to specify another XML name or namespace for the attribute or types.

I tried with and without using the -t- option but the error is the same.

Steps to reproduce

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions