Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Internet
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Colaboración Paypal con ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo Hace 9 Horas
unomasmas unomasmas is offline
Miembro
 
Registrado: dic 2019
Posts: 196
Poder: 7
unomasmas Va por buen camino
Cita:
Empezado por adolphsys Ver Mensaje
Probado en las tres haciendas, en server de pruebas y todo OK!
La semana pasada todo funcionaba bien pero ahora, en Bizkaia, me da problemas al intentar hacer la validación del fichero xml a enviar. El error se produce en la línea "schema.Add(xsdFile, xsdFile);" del siguiente código C#.

Código:
try
{
    _isValid = true;

    string xsdFile = "https://www.batuz.eus/fitxategiak/batuz/LROE/esquemas/LROE_PF_140_1_1_Ingresos_ConfacturaConSG_AltaPeticion_V1_0_2.xsd";
    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

    XmlSchemaSet schema = new XmlSchemaSet();
    schema.Add(xsdFile, xsdFile);

    using (XmlReader rd = XmlReader.Create(xmlFile))
    {
        XDocument doc = XDocument.Load(rd);
        doc.Validate(schema, ValidationCallBack);
    }

    if (!_isValid)
    {
        string cpt = string.Format("Processing {0}. {1}", GetFileName(xmlFile), MethodBase.GetCurrentMethod().Name);
        MessageBox.Show(_noValidInformation.TrimEnd(Environment.NewLine.ToCharArray()), cpt, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification);
    }
    return _isValid;
}
catch (WebException ex)
{
    //string statuscode = string.Format("Estado: {0}. {1}", ((HttpWebResponse)ex.Response).StatusCode, ((HttpWebResponse)ex.Response).StatusDescription);
    string statuscode = string.Format("Estado: {0}", ex.Status);
    _error = string.Format("{0}. {1}", ex.Message, statuscode);
    //MessageBox.Show(ex.Message, MethodBase.GetCurrentMethod().Name, MessageBoxButtons.OK, MessageBoxIcon.Error);
    string cpt = string.Format("WebException: Processing {0}. {1}", System.IO.Path.GetFileName(xmlFile), System.Reflection.MethodBase.GetCurrentMethod().Name);
    MessageBox.Show(string.Format("{0}{1}{2}", statuscode, System.Environment.NewLine, ex.Message), cpt, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification);
    return false;
}
catch (Exception ex)
{
    //isValid = false; no need to say isValid=false as it returns false
    _error = ex.Message;
    //MessageBox.Show(ex.Message, .MethodBase.GetCurrentMethod().Name, MessageBoxButtons.OK, MessageBoxIcon.Error);
    string cpt = string.Format("Processing {0}. {1}", System.IO.Path.GetFileName(xmlFile), System.Reflection.MethodBase.GetCurrentMethod().Name);
    MessageBox.Show(ex.Message, cpt, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification);
    return false;
}
¿Cómo hacéis la validación del cumplimiento del esquema vosotros? Gracias.
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
SII -Nuevo sistema de la Agencia Tributaria española de envío de datos vía Webservice newtron Internet 3716 19-01-2026 21:01:34
Como utilizar la ayuda del nuevo Sistema Operativo gluglu Humor 3 24-09-2007 10:39:05
Aplicacion Agencia De Viajes ArdiIIa Varios 9 20-01-2007 17:49:53
El Vasco Aguirre Al González La Taberna 5 26-05-2006 10:22:28
Microsoft ha lanzado su nuevo sistema operativo DarkByte Humor 0 25-01-2004 10:21:14


La franja horaria es GMT +2. Ahora son las 08:21:01.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi