Cita:
Empezado por batuzail
Hola,
Para convertir en xml la respuesta yo uso
Código:
public bool GetXMLFromObject(object o)
{
StringWriter sw = new StringWriter();
XmlTextWriter tw = null;
try
{
XmlSerializer serializer = new XmlSerializer(o.GetType());
tw = new XmlTextWriter(sw);
serializer.Serialize(tw, o);
}
catch (Exception ex)
{
//Handle Exception Code
return false;
}
finally
{
sw.Close();
if (tw != null)
{
tw.Close();
}
}
using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"C:\tmp\" + o.ToString() + ".xml"))
{
file.WriteLine(sw.ToString());
}
return true;
}
|
Creo que el problema es que el xml que devuelve AEAT (fichero) al deserializarlo con el objeto falla. Yo me encontre con el problema hace tiempo e incluso creo recordar que consulte por aqui. Si haces el replace digamos que el xml tiene el formato que espera la deserializacion.