xml - XmlSerializer c++ Deserialize with multiple namespaces -


i having following problem, concerning xmlserializer of microsoft (c++) , deserialization process. ds:signature not desiarialized , undentified value. can spot mistake? code follows: xml following:

<?xml version="1.0" encoding="utf-8"?> <test  xmlns:ds="http://www.w3.org/2000/09/xmldsig#">     <aa>         <version>0.1.1</version>     </aa>     <bb>         <cc>             <id>134324321421</id>             <ds:signature>                 <ds:signedinfo>                     <ds:canonicalizationmethod algorithm="http://www.w3.org/tr/2001/rec-xml-c14n-20010315#withcomments"/>                     <ds:signaturemethod algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>                     <ds:reference id="1" type="" uri="something">                         <ds:transforms>                             <ds:transform algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>                         </ds:transforms>                         <ds:digestmethod algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>                         <ds:digestvalue>43=</ds:digestvalue>                     </ds:reference>                 </ds:signedinfo>                 <ds:signaturevalue>                 4344             </ds:signaturevalue>                 <ds:keyinfo>                     <ds:keyvalue>                         <ds:rsakeyvalue>                             <ds:modulus>                             4543434                         </ds:modulus>                             <ds:exponent>43</ds:exponent>                         </ds:rsakeyvalue>                     </ds:keyvalue>                     <ds:x509data>                         <ds:x509certificate>                         3454343243242                     </ds:x509certificate>                     </ds:x509data>                 </ds:keyinfo>             </ds:signature>         </cc>     </bb> </aa> 

and code follows:

#using <mscorlib.dll> #using <system.dll> #using <system.xml.dll>  //  // source code auto-generated xsd, version=2.0.50727.3038. //  using namespace system::xml::serialization; using namespace system; namespace ds{  ref class _keyinfo; ref class _keyvalue; ref class _rsakeyvalue; ref class _x509data; ref class _reference; ref class _transforms; ref class _transform; ref class _digestmethod; ref class _signature; ref class _signedinfo; ref class _canonicalizationmethod; ref class _signaturemethod;   /// <remarks/>  public ref class _keyinfo {      private: _keyvalue^  keyvaluefield;      private: _x509data^  x509datafield;      /// <remarks/>     public: [system::xml::serialization::xmlelement("keyvalue", namespace = "http://www.w3.org/2000/09/xmldsig")]     property _keyvalue^  keyvalue {         _keyvalue^  get();         system::void set(_keyvalue^  value);     }      /// <remarks/>     public: [system::xml::serialization::xmlelement("x509data", namespace = "http://www.w3.org/2000/09/xmldsig")]     property _x509data^  x509data {         _x509data^  get();         system::void set(_x509data^  value);     } };   public ref class _keyvalue {      private: _rsakeyvalue^  rsakeyvaluefield;      /// <remarks/>     public: [system::xml::serialization::xmlelement("rsakeyvalue", namespace = "http://www.w3.org/2000/09/xmldsig")]     property _rsakeyvalue^  rsakeyvalue {         _rsakeyvalue^  get();         system::void set(_rsakeyvalue^  value);     } };   public ref class _rsakeyvalue {      private: system::string^  modulusfield;      private: system::string^ exponentfield;      /// <remarks/>     public: [system::xml::serialization::xmlelement("modulus", namespace = "http://www.w3.org/2000/09/xmldsig")]     property system::string^  modulus {         system::string^  get();         system::void set(system::string^  value);     }      /// <remarks/>     public: [system::xml::serialization::xmlelement("exponent", namespace = "http://www.w3.org/2000/09/xmldsig")]     property system::string^ exponent {         system::string^ get();         system::void set(system::string^ value);     } };   public ref class _x509data {      private: system::string^  x509certificatefield;      /// <remarks/>     public: [system::xml::serialization::xmlelement("x509certificate", namespace = "http://www.w3.org/2000/09/xmldsig")]     property system::string^  x509certificate {         system::string^  get();         system::void set(system::string^  value);     } };   public ref class _reference {      private: _transforms^  transformsfield;      private: _digestmethod^  digestmethodfield;      private: system::string^ digestvaluefield;      private: system::string^ idfield;      private: system::string^ typefield;      private: system::string^ urifield;      /// <remarks/>     public: [system::xml::serialization::xmlelement("transforms", namespace = "http://www.w3.org/2000/09/xmldsig")]     property _transforms^  transforms {         _transforms^  get();         system::void set(_transforms^  value);     }      /// <remarks/>     public: [system::xml::serialization::xmlelement("digestmethod", namespace = "http://www.w3.org/2000/09/xmldsig")]     property _digestmethod^  digestmethod {         _digestmethod^  get();         system::void set(_digestmethod^  value);     }      /// <remarks/>     public: [system::xml::serialization::xmlelement("digestvalue", namespace = "http://www.w3.org/2000/09/xmldsig")]     property system::string^ digestvalue {         system::string^ get();         system::void set(system::string^ value);     }      /// <remarks/>     public: [system::xml::serialization::xmlelement("id", namespace = "http://www.w3.org/2000/09/xmldsig")]     property system::string^ id {         system::string^ get();         system::void set(system::string^ value);     }      /// <remarks/>     public: [system::xml::serialization::xmlelement("type", namespace = "http://www.w3.org/2000/09/xmldsig")]     property system::string^ type {         system::string^ get();         system::void set(system::string^ value);     }      /// <remarks/>     public: [system::xml::serialization::xmlelement("uri", namespace = "http://www.w3.org/2000/09/xmldsig")]     property system::string^ uri {         system::string^ get();         system::void set(system::string^ value);     } };   public ref class _transforms {      private: _transform^  transformfield;      /// <remarks/>     public: [system::xml::serialization::xmlelement("transform", namespace = "http://www.w3.org/2000/09/xmldsig")]     property _transform^  transform {         _transform^  get();         system::void set(_transform^  value);     } };   public ref class _transform {      private: system::string^  algorithmfield;      /// <remarks/>     public: [system::xml::serialization::xmlelement("algorithm", namespace = "http://www.w3.org/2000/09/xmldsig")]     property system::string^  algorithm {         system::string^  get();         system::void set(system::string^  value);     } };  [system::xml::serialization::xmlroot("digestmethod", namespace = "http://www.w3.org/2000/09/xmldsig")] public ref class _digestmethod {  private: system::string ^algorithmfield;      /// <remarks/>     public: [system::xml::serialization::xmlelement("algorithm", namespace = "http://www.w3.org/2000/09/xmldsig")]     property system::string^  algorithm {         system::string^  get();         system::void set(system::string^  value);     } };    public ref class _signedinfo {      private: _canonicalizationmethod^  canonicalizationmethodfield;      private: _signaturemethod^  signaturemethodfield;      private: _reference^  referencefield;      /// <remarks/>     public: [system::xml::serialization::xmlelement("canonicalizationmethod", namespace = "http://www.w3.org/2000/09/xmldsig")]     property _canonicalizationmethod^  canonicalizationmethod {         _canonicalizationmethod^  get();         system::void set(_canonicalizationmethod^  value);     }      /// <remarks/>     public: [system::xml::serialization::xmlelement("signaturemethod", namespace = "http://www.w3.org/2000/09/xmldsig")]     property _signaturemethod^  signaturemethod {         _signaturemethod^  get();         system::void set(_signaturemethod^  value);     }      /// <remarks/>     public: [system::xml::serialization::xmlelement("reference", namespace = "http://www.w3.org/2000/09/xmldsig")]     property _reference^  reference {         _reference^  get();         system::void set(_reference^  value);     } };   public ref class _canonicalizationmethod {      private: system::string^  algorithmfield;      /// <remarks/>     public: [system::xml::serialization::xmlelement("algorithm", namespace = "http://www.w3.org/2000/09/xmldsig")]     property system::string^  algorithm {         system::string^  get();         system::void set(system::string^  value);     } };   public ref class _signaturemethod {      private: system::string ^algorithmfield;      /// <remarks/>     public: [system::xml::serialization::xmlelement("algorithm", namespace = "http://www.w3.org/2000/09/xmldsig")]     property system::string^  algorithm {         system::string^  get();         system::void set(system::string^  value);     } };    public ref class signature {      private: _signedinfo^  signedinfofield;      private: system::string^  signaturevaluefield;      private: _keyinfo^  keyinfofield;      /// <remarks/>     public: [system::xml::serialization::xmlelement("signedinfo", namespace = "http://www.w3.org/2000/09/xmldsig")]     property _signedinfo^  signedinfo {         _signedinfo^  get();         system::void set(_signedinfo^  value);     }      /// <remarks/>     public: [system::xml::serialization::xmlelement("signaturevalue", namespace = "http://www.w3.org/2000/09/xmldsig")]     property system::string^  signaturevalue {         system::string^  get();         system::void set(system::string^  value);     }      /// <remarks/>     public: [system::xml::serialization::xmlelement("keyinfo", namespace = "http://www.w3.org/2000/09/xmldsig")]     property _keyinfo^  keyinfo {         _keyinfo^  get();         system::void set(_keyinfo^  value);     } };     inline _keyvalue^  _keyinfo::keyvalue::get() {     return this->keyvaluefield; } inline system::void _keyinfo::keyvalue::set(_keyvalue^  value) {     this->keyvaluefield = value; }  inline _x509data^  _keyinfo::x509data::get() {     return this->x509datafield; } inline system::void _keyinfo::x509data::set(_x509data^  value) {     this->x509datafield = value; }   inline _rsakeyvalue^  _keyvalue::rsakeyvalue::get() {     return this->rsakeyvaluefield; } inline system::void _keyvalue::rsakeyvalue::set(_rsakeyvalue^  value) {     this->rsakeyvaluefield = value; }   inline system::string^  _rsakeyvalue::modulus::get() {     return this->modulusfield; } inline system::void _rsakeyvalue::modulus::set(system::string^  value) {     this->modulusfield = value; }  inline system::string^ _rsakeyvalue::exponent::get() {     return this->exponentfield; } inline system::void _rsakeyvalue::exponent::set(system::string^ value) {     this->exponentfield = value; }   inline system::string^  _x509data::x509certificate::get() {     return this->x509certificatefield; } inline system::void _x509data::x509certificate::set(system::string^  value) {     this->x509certificatefield = value; }   inline _transforms^  _reference::transforms::get() {     return this->transformsfield; } inline system::void _reference::transforms::set(_transforms^  value) {     this->transformsfield = value; }  inline _digestmethod^  _reference::digestmethod::get() {     return this->digestmethodfield; } inline system::void _reference::digestmethod::set(_digestmethod^  value) {     this->digestmethodfield = value; }  inline system::string^ _reference::digestvalue::get() {     return this->digestvaluefield; } inline system::void _reference::digestvalue::set(system::string^ value) {     this->digestvaluefield = value; }  inline system::string^ _reference::id::get() {     return this->idfield; } inline system::void _reference::id::set(system::string^ value) {     this->idfield = value; }  inline system::string^ _reference::type::get() {     return this->typefield; } inline system::void _reference::type::set(system::string^ value) {     this->typefield = value; }  inline system::string^ _reference::uri::get() {     return this->urifield; } inline system::void _reference::uri::set(system::string^ value) {     this->urifield = value; }   inline _transform^  _transforms::transform::get() {     return this->transformfield; } inline system::void _transforms::transform::set(_transform^  value) {     this->transformfield = value; }   inline system::string^  _transform::algorithm::get() {     return this->algorithmfield; } inline system::void _transform::algorithm::set(system::string^  value) {     this->algorithmfield = value; }   inline system::string^ _digestmethod::algorithm::get() {     return this->algorithmfield; } inline system::void _digestmethod::algorithm::set(system::string^ value) {     this->algorithmfield = value; }   inline _signedinfo^  signature::signedinfo::get() {     return this->signedinfofield; } inline system::void signature::signedinfo::set(_signedinfo^  value) {     this->signedinfofield = value; }  inline system::string^  signature::signaturevalue::get() {     return this->signaturevaluefield; } inline system::void signature::signaturevalue::set(system::string^  value) {     this->signaturevaluefield = value; }  inline _keyinfo^  signature::keyinfo::get() {     return this->keyinfofield; } inline system::void signature::keyinfo::set(_keyinfo^  value) {     this->keyinfofield = value; }   inline _canonicalizationmethod^  _signedinfo::canonicalizationmethod::get() {     return this->canonicalizationmethodfield; } inline system::void _signedinfo::canonicalizationmethod::set(_canonicalizationmethod^  value) {     this->canonicalizationmethodfield = value; }  inline _signaturemethod^  _signedinfo::signaturemethod::get() {     return this->signaturemethodfield; } inline system::void _signedinfo::signaturemethod::set(_signaturemethod^  value) {     this->signaturemethodfield = value; }  inline _reference^  _signedinfo::reference::get() {     return this->referencefield; } inline system::void _signedinfo::reference::set(_reference^  value) {     this->referencefield = value; }   inline system::string^  _canonicalizationmethod::algorithm::get() {     return this->algorithmfield; } inline system::void _canonicalizationmethod::algorithm::set(system::string^  value) {     this->algorithmfield = value; }   inline system::string^ _signaturemethod::algorithm::get() {     return this->algorithmfield; } inline system::void _signaturemethod::algorithm::set(system::string^ value) {     this->algorithmfield = value; } };  ///====================================================================================  public ref class aa{ public:     system::string^ version; };  public ref class cc{ public:     system::string^ id;      public: [system::xml::serialization::xmlelement("signature", namespace = "http://www.w3.org/2000/09/xmldsig")]     ds::signature^  signature  };  public ref class bb{ public:     cc ^cc };  [system::xml::serialization::xmlroot("test", namespace = "")] public ref class test { public:     aa ^aa;     bb ^bb;  };  //==============================================================================             nametable^ nt = gcnew nametable();            xmlnamespacemanager ^ namesp = gcnew xmlnamespacemanager (nt);             namesp->addnamespace("ds", "http://www.w3.org/2000/09/xmldsig#");            xmlserializer^ serializer = gcnew xmlserializer( test::typeid, "http://www.w3.org/2000/09/xmldsig#");             // filestream needed read xml document.            filestream^ fs = gcnew filestream( filename,filemode::open );             xmlreader^ reader = gcnew xmltextreader( fs,namesp->nametable);             // declare object variable of type deserialized.            test^ i;             // use deserialize method restore object's state.            = dynamic_cast<test^>(serializer->deserialize( reader)); 

you have few problems here:

  1. the namespace in xml http://www.w3.org/2000/09/xmldsig# in c++ attribute decorations omit trailing #, instance:

    public: [system::xml::serialization::xmlelement("signature", namespace = "http://www.w3.org/2000/09/xmldsig")] ds::signature^  signature  

    the namespace mismatch causes signature not read.

  2. several of fields have decorated xmlelement appear attributes in xml file, , need decorated xmlattribute, instance:

    public: [system::xml::serialization::xmlelement("id", namespace = "http://www.w3.org/2000/09/xmldsig")] property system::string^ id {     system::string^ get();     system::void set(system::string^ value); } 
  3. in addition, fields need marked attributes need placed in empty namespace. instance, in line <ds:reference id="1" type="" uri="something">, notice id, type , uri not have ds: prefix? means they're not in namespace.

with these issues fixed in code below, can read xml provide.

public ref class _keyinfo {      private: _keyvalue^  keyvaluefield;      private: _x509data^  x509datafield;      /// <remarks/>     public: [system::xml::serialization::xmlelement("keyvalue", namespace = "http://www.w3.org/2000/09/xmldsig#")]     property _keyvalue^  keyvalue {         _keyvalue^  get();         system::void set(_keyvalue^  value);     }      /// <remarks/>     public: [system::xml::serialization::xmlelement("x509data", namespace = "http://www.w3.org/2000/09/xmldsig#")]     property _x509data^  x509data {         _x509data^  get();         system::void set(_x509data^  value);     } };   public ref class _keyvalue {      private: _rsakeyvalue^  rsakeyvaluefield;      /// <remarks/>     public: [system::xml::serialization::xmlelement("rsakeyvalue", namespace = "http://www.w3.org/2000/09/xmldsig#")]     property _rsakeyvalue^  rsakeyvalue {         _rsakeyvalue^  get();         system::void set(_rsakeyvalue^  value);     } };   public ref class _rsakeyvalue {      private: system::string^  modulusfield;      private: system::string^ exponentfield;      /// <remarks/>     public: [system::xml::serialization::xmlelement("modulus", namespace = "http://www.w3.org/2000/09/xmldsig#")]     property system::string^  modulus {         system::string^  get();         system::void set(system::string^  value);     }      /// <remarks/>     public: [system::xml::serialization::xmlelement("exponent", namespace = "http://www.w3.org/2000/09/xmldsig#")]     property system::string^ exponent {         system::string^ get();         system::void set(system::string^ value);     } };   public ref class _x509data {      private: system::string^  x509certificatefield;      /// <remarks/>     public: [system::xml::serialization::xmlelement("x509certificate", namespace = "http://www.w3.org/2000/09/xmldsig#")]     property system::string^  x509certificate {         system::string^  get();         system::void set(system::string^  value);     } };   public ref class _reference {      private: _transforms^  transformsfield;      private: _digestmethod^  digestmethodfield;      private: system::string^ digestvaluefield;      private: system::string^ idfield;      private: system::string^ typefield;      private: system::string^ urifield;      /// <remarks/>     public: [system::xml::serialization::xmlelement("transforms", namespace = "http://www.w3.org/2000/09/xmldsig#")]     property _transforms^  transforms {         _transforms^  get();         system::void set(_transforms^  value);     }      /// <remarks/>     public: [system::xml::serialization::xmlelement("digestmethod", namespace = "http://www.w3.org/2000/09/xmldsig#")]     property _digestmethod^  digestmethod {         _digestmethod^  get();         system::void set(_digestmethod^  value);     }      /// <remarks/>     public: [system::xml::serialization::xmlelement("digestvalue", namespace = "http://www.w3.org/2000/09/xmldsig#")]     property system::string^ digestvalue {         system::string^ get();         system::void set(system::string^ value);     }      /// <remarks/>     public: [system::xml::serialization::xmlattribute("id", namespace = "")]     property system::string^ id {         system::string^ get();         system::void set(system::string^ value);     }      /// <remarks/>     public: [system::xml::serialization::xmlattribute("type", namespace = "")]     property system::string^ type {         system::string^ get();         system::void set(system::string^ value);     }      /// <remarks/>     public: [system::xml::serialization::xmlattribute("uri", namespace = "")]     property system::string^ uri {         system::string^ get();         system::void set(system::string^ value);     } };   public ref class _transforms {      private: _transform^  transformfield;      /// <remarks/>     public: [system::xml::serialization::xmlelement("transform", namespace = "http://www.w3.org/2000/09/xmldsig#")]     property _transform^  transform {         _transform^  get();         system::void set(_transform^  value);     } };   public ref class _transform {      private: system::string^  algorithmfield;      /// <remarks/>     public: [system::xml::serialization::xmlattribute("algorithm", namespace = "")]     property system::string^  algorithm {         system::string^  get();         system::void set(system::string^  value);     } };  [system::xml::serialization::xmlroot("digestmethod", namespace = "http://www.w3.org/2000/09/xmldsig#")] public ref class _digestmethod {  private: system::string ^algorithmfield;      /// <remarks/>     public: [system::xml::serialization::xmlattribute("algorithm", namespace = "")]     property system::string^  algorithm {         system::string^  get();         system::void set(system::string^  value);     } };    public ref class _signedinfo {      private: _canonicalizationmethod^  canonicalizationmethodfield;      private: _signaturemethod^  signaturemethodfield;      private: _reference^  referencefield;      /// <remarks/>     public: [system::xml::serialization::xmlelement("canonicalizationmethod", namespace = "http://www.w3.org/2000/09/xmldsig#")]     property _canonicalizationmethod^  canonicalizationmethod {         _canonicalizationmethod^  get();         system::void set(_canonicalizationmethod^  value);     }      /// <remarks/>     public: [system::xml::serialization::xmlelement("signaturemethod", namespace = "http://www.w3.org/2000/09/xmldsig#")]     property _signaturemethod^  signaturemethod {         _signaturemethod^  get();         system::void set(_signaturemethod^  value);     }      /// <remarks/>     public: [system::xml::serialization::xmlelement("reference", namespace = "http://www.w3.org/2000/09/xmldsig#")]     property _reference^  reference {         _reference^  get();         system::void set(_reference^  value);     } };   public ref class _canonicalizationmethod {      private: system::string^  algorithmfield;      /// <remarks/>     public: [system::xml::serialization::xmlattribute("algorithm", namespace = "")]     property system::string^  algorithm {         system::string^  get();         system::void set(system::string^  value);     } };   public ref class _signaturemethod {      private: system::string ^algorithmfield;      /// <remarks/>     public: [system::xml::serialization::xmlattribute("algorithm", namespace = "")]     property system::string^  algorithm {         system::string^  get();         system::void set(system::string^  value);     } };    public ref class signature {      private: _signedinfo^  signedinfofield;      private: system::string^  signaturevaluefield;      private: _keyinfo^  keyinfofield;      /// <remarks/>     public: [system::xml::serialization::xmlelement("signedinfo", namespace = "http://www.w3.org/2000/09/xmldsig#")]     property _signedinfo^  signedinfo {         _signedinfo^  get();         system::void set(_signedinfo^  value);     }      /// <remarks/>     public: [system::xml::serialization::xmlelement("signaturevalue", namespace = "http://www.w3.org/2000/09/xmldsig#")]     property system::string^  signaturevalue {         system::string^  get();         system::void set(system::string^  value);     }      /// <remarks/>     public: [system::xml::serialization::xmlelement("keyinfo", namespace = "http://www.w3.org/2000/09/xmldsig#")]     property _keyinfo^  keyinfo {         _keyinfo^  get();         system::void set(_keyinfo^  value);     } };     inline _keyvalue^  _keyinfo::keyvalue::get() {     return this->keyvaluefield; } inline system::void _keyinfo::keyvalue::set(_keyvalue^  value) {     this->keyvaluefield = value; }  inline _x509data^  _keyinfo::x509data::get() {     return this->x509datafield; } inline system::void _keyinfo::x509data::set(_x509data^  value) {     this->x509datafield = value; }   inline _rsakeyvalue^  _keyvalue::rsakeyvalue::get() {     return this->rsakeyvaluefield; } inline system::void _keyvalue::rsakeyvalue::set(_rsakeyvalue^  value) {     this->rsakeyvaluefield = value; }   inline system::string^  _rsakeyvalue::modulus::get() {     return this->modulusfield; } inline system::void _rsakeyvalue::modulus::set(system::string^  value) {     this->modulusfield = value; }  inline system::string^ _rsakeyvalue::exponent::get() {     return this->exponentfield; } inline system::void _rsakeyvalue::exponent::set(system::string^ value) {     this->exponentfield = value; }   inline system::string^  _x509data::x509certificate::get() {     return this->x509certificatefield; } inline system::void _x509data::x509certificate::set(system::string^  value) {     this->x509certificatefield = value; }   inline _transforms^  _reference::transforms::get() {     return this->transformsfield; } inline system::void _reference::transforms::set(_transforms^  value) {     this->transformsfield = value; }  inline _digestmethod^  _reference::digestmethod::get() {     return this->digestmethodfield; } inline system::void _reference::digestmethod::set(_digestmethod^  value) {     this->digestmethodfield = value; }  inline system::string^ _reference::digestvalue::get() {     return this->digestvaluefield; } inline system::void _reference::digestvalue::set(system::string^ value) {     this->digestvaluefield = value; }  inline system::string^ _reference::id::get() {     return this->idfield; } inline system::void _reference::id::set(system::string^ value) {     this->idfield = value; }  inline system::string^ _reference::type::get() {     return this->typefield; } inline system::void _reference::type::set(system::string^ value) {     this->typefield = value; }  inline system::string^ _reference::uri::get() {     return this->urifield; } inline system::void _reference::uri::set(system::string^ value) {     this->urifield = value; }   inline _transform^  _transforms::transform::get() {     return this->transformfield; } inline system::void _transforms::transform::set(_transform^  value) {     this->transformfield = value; }   inline system::string^  _transform::algorithm::get() {     return this->algorithmfield; } inline system::void _transform::algorithm::set(system::string^  value) {     this->algorithmfield = value; }   inline system::string^ _digestmethod::algorithm::get() {     return this->algorithmfield; } inline system::void _digestmethod::algorithm::set(system::string^ value) {     this->algorithmfield = value; }   inline _signedinfo^  signature::signedinfo::get() {     return this->signedinfofield; } inline system::void signature::signedinfo::set(_signedinfo^  value) {     this->signedinfofield = value; }  inline system::string^  signature::signaturevalue::get() {     return this->signaturevaluefield; } inline system::void signature::signaturevalue::set(system::string^  value) {     this->signaturevaluefield = value; }  inline _keyinfo^  signature::keyinfo::get() {     return this->keyinfofield; } inline system::void signature::keyinfo::set(_keyinfo^  value) {     this->keyinfofield = value; }   inline _canonicalizationmethod^  _signedinfo::canonicalizationmethod::get() {     return this->canonicalizationmethodfield; } inline system::void _signedinfo::canonicalizationmethod::set(_canonicalizationmethod^  value) {     this->canonicalizationmethodfield = value; }  inline _signaturemethod^  _signedinfo::signaturemethod::get() {     return this->signaturemethodfield; } inline system::void _signedinfo::signaturemethod::set(_signaturemethod^  value) {     this->signaturemethodfield = value; }  inline _reference^  _signedinfo::reference::get() {     return this->referencefield; } inline system::void _signedinfo::reference::set(_reference^  value) {     this->referencefield = value; }   inline system::string^  _canonicalizationmethod::algorithm::get() {     return this->algorithmfield; } inline system::void _canonicalizationmethod::algorithm::set(system::string^  value) {     this->algorithmfield = value; }   inline system::string^ _signaturemethod::algorithm::get() {     return this->algorithmfield; } inline system::void _signaturemethod::algorithm::set(system::string^ value) {     this->algorithmfield = value; } };  ///====================================================================================  public ref class aa{ public:     system::string^ version; };  public ref class cc{ public:     system::string^ id;      public: [system::xml::serialization::xmlelement("signature", namespace = "http://www.w3.org/2000/09/xmldsig#")]     ds::signature^  signature;  };  public ref class bb{ public:     cc ^cc; };  [system::xml::serialization::xmlroot("test", namespace = "")] public ref class test { public:     aa ^aa;     bb ^bb;  }; 

for future, 1 way check work have been use xsd.exe generate c# classes xml, compare auto-generated c# classes manually created c++ classes. have seen problem.


Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -