This is what I am trying to do:
FileStream fs = new FileStream("C:\ \request1.xml", FileMode.Open);
XmlSerializer x = new XmlSerializer(t ypeof(Podpisani DokumentTip));
PodpisaniDokume ntTip doc = (PodpisaniDokum entTip)x.Deseri alize(fs);
And this is my class (auto generated from WSDL):
[System.CodeDom. Compiler.Genera tedCodeAttribut e("System.Xml ",
"2.0.50727. 42")]
[System.Serializ ableAttribute()]
[System.Diagnost ics.DebuggerSte pThroughAttribu te()]
[System.Componen tModel.Designer CategoryAttribu te("code")]
[System.Xml.Seri alization.XmlTy peAttribute(Nam espace="http://www.example.org/PodpisaniDokume nt")]
public partial class PodpisaniDokume ntTip {
...
}
This is XML:
<sgn:PodpisaniD okument xmlns:sgn="http ://www.example.org/PodpisaniDokume nt">
....
</sgn:PodpisaniDo kument>
This is the error message during deserialization :
---------------------------
---------------------------
System.InvalidO perationExcepti on: <PodpisaniDokum ent
xmlns='http://www.example.org/PodpisaniDokume nt'> was not expected.
at
Microsoft.Xml.S erialization.Ge neratedAssembly .XmlSerializati onReaderPodpisa niDokumentTip.R ead36_Podpisani Dokument()
---------------------------
OK
---------------------------
What is wrong?
I've found this:
http://www.dotnet247.com/247referenc...58/294121.aspx http://www.dotnet247.com/247referenc...46/231255.aspx
but it doesn't help me. :(