0

I want to deserialize XML into object. I have no controll what xml i'm reciving, and into what object I'm deserializing.

I tried this: Can I make XmlSerializer ignore the namespace on deserialization? and it worked... almost.

my xml

    <request xmlns:a="http://schemas.datacontract.org/2004/07/My.Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/">
      <a:ProfileInfo i:type="a:ProfileAndBSymbol">
        <a:BSymbol>_47</a:BSymbol>
        <a:ProfileSymbol>FAJNY</a:ProfileSymbol>
      </a:ProfileInfo>
    </request>

a:ProfileInfo works fine, but i:type thrown an exception. How to ignore i:?

exception is in Polish and it is like this:

InvalidOperationException: type is invalid. name= ProfileAndBSymbol, namespace=http://schemas.datacontract.org/2004/07/My.Contracts

Pavel Anikhouski
  • 21,776
  • 12
  • 51
  • 66
Capitan Planet
  • 155
  • 3
  • 14

0 Answers0