Click here to Skip to main content
15,892,298 members

Comments by Member 12760369 (Top 7 by date)

Member 12760369 5 days ago View    
I already did it and the result is the same
Member 12760369 5 days ago View    
I generated a variable where I ensure the value of the parameter, effectively obtaining the corresponding value as a result, but it still gives me the same error.
The code where I call the datatable is:

valorcombo = $("#cbbunidad").val();
debugger

tabladata = $("#tabla").DataTable({
destroy: true,
responsive: true,
ordering: false,
"ajax": {
url: "@Url.Action("ListarIntegrantesUnidad", "Mantenedor")",
type: "GET",
data: JSON.stringify({ intId: valorcombo }),
datatype: "json"
},
"columns": [
{ "data": "intId" },
{ "data": "intNombre" },
{ "data": "intFechaNacimiento" },
{ "data": "intEdad" },
{ "data": "intCargo" },
{ "data": "intTipoDocumento" },
{ "data": "intNumeroDocumento" },
{ "data": "intRelacion" },
{
"defaultContent": '' +
'',
"orderable": false,
"searchable": false,
"width": "90px"
}
],
"language": {
"url": "https://cdn.datatables.net/plug-ins/2.0.2/i18n/es-ES.json",
}
})
Member 12760369 29-Apr-24 15:36pm View    
In the debugger, before starting the definition of the table, it shows me the correct value of the combo, but once it enters the table is when the error occurs. I modified passing the parameter from POST to GET but it remains the same.
The method I use in the Maintainer controller is:

[HttpGet]
public JsonResult ListarIntegrantesUnidad(int idunidad)
{
List<entidadintegrantesunidad> oLista = new List<entidadintegrantesunidad>();
oLista = new CN_IntegrantesUnidad().ListarenUnidad(idunidad);
return Json(new { data = oLista }, JsonRequestBehavior.AllowGet);
}
Member 12760369 28-Apr-24 8:44am View    
The console message I get in the debugger is

jquery-3.4.1.js:9837


POST https://localhost:44310/Mantenedor/ListarIntegrantesUnidad 500 (Internal Server Error)

and the response is




<title>El diccionario de parámetros contiene una entrada NULL para el parámetro 'idunidad' del tipo que no acepta valores NULL 'System.Int32' del método 'System.Web.Mvc.JsonResult ListarIntegrantesUnidad(Int32)' en 'CapaPresentacion.Controllers.MantenedorController'. Un parámetro opcional debe ser un tipo de referencia, un tipo que acepte valores NULL o debe declararse como parámetro opcional.<br>Nombre del parámetro: parameters




Detalles de la excepción: System.ArgumentException: El diccionario de parámetros contiene una entrada NULL para el parámetro 'idunidad' del tipo que no acepta valores NULL 'System.Int32' del método 'System.Web.Mvc.JsonResult ListarIntegrantesUnidad(Int32)' en 'CapaPresentacion.Controllers.MantenedorController'. Un parámetro opcional debe ser un tipo de referencia, un tipo que acepte valores NULL o debe declararse como parámetro opcional.Nombre del parámetro: parameters

Error de código fuente:




Se ha generado una excepción no controlada durante la ejecución de la solicitud Web actual. La información sobre el origen y la ubicación de la excepción pueden identificarse utilizando la excepción del seguimiento de la pila siguiente.



Seguimiento de la pila:


<pre>

[ArgumentException: El diccionario de parámetros contiene una entrada NULL para el parámetro 'idunidad' del tipo que no acepta valores NULL 'System.Int32' del método 'System.Web.Mvc.JsonResult ListarIntegrantesUnidad(Int32)' en 'CapaPresentacion.Controllers.MantenedorController'. Un parámetro opc
Member 12760369 30-Aug-23 1:08am View    
Thank you. Indeed in order not to publish sensitive information, I edited the document. The VBNET code manages to get into the loop you send me, but I haven't been able to get the values ​​of the propertyNode element. The XML with the corresponding tags is as follows

<cbc:Description>
<![CDATA[ <?xml version="1.0" encoding="utf-8" standalone="no"?><ApplicationResponse xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:sts="dian:gov:co:facturaelectronica:Structures-2-1" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns="urn:oasis:names:specification:ubl:schema:xsd:ApplicationResponse-2"> 
<ext:UBLExtensions> <ext:UBLExtension> <ext:ExtensionContent> <sts:DDDExtensions> <sts:InvoiceSource> <cbc:IdentificationCode listAgencyID="6" listAgencyName="United Nations Economic Commission for Europe" listSchemeURI="urn:oasis:names:specification:ubl:codelist:gc:CountryIdentificationCode-2.1">CO</cbc:IdentificationCode> </sts:InvoiceSource> <sts:SoftwareProvider> <sts:ProviderID schemeID="2" schemeName="13" schemeAgencyID="19" schemeAgencyName="Enterprise">999999999</sts:ProviderID> <sts:SoftwareID schemeAgencyID="19" schemeAgencyName="Enterprise">...</sts:SoftwareID> </sts:SoftwareProvider> 
<sts:SoftwareSecurityCode schemeAgencyID="19" schemeAgencyName="Enterprise">...</sts:SoftwareSecurityCode> <sts:AuthorizationProvider> <sts:AuthorizationProviderID schemeID="2" schemeName="13" schemeAgencyID="19" schemeAgencyName="Enterprise">999999999</sts:AuthorizationProviderID> </sts:AuthorizationProvider> </sts:DDDExtensions> </ext:ExtensionContent> </ext:UBLExtension> <ext:UBLExtension> <ext:ExtensionContent><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="SignatureXXX"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /><ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" /><ds:Reference Id="ReferenceXXX" URI=""><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>MMMMMMMMMMMMM</ds:DigestValue></ds:Reference><ds:Reference Id="ReferenceKeyInfo" URI="#SignatureXXX-KeyInfo"><ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" /><ds:DigestValue>/UbeitEkyZn4cM2EJb7NqeJG/AKn51rEbNNaVjbVwB8=</ds:DigestValue></ds:Reference><ds:Reference Type="http://uri.etsi.org/01903#SignedProperties" URI="#xmldsig-SignatureXXX-signedprops"><ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" /><ds:DigestValue>AAAAAAAAAAAA</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue Id="SignatureValue-TTTTTTTTTTT">YUTYUTYUTYU76876uyuyu</ds:SignatureValue><ds:KeyInfo Id="SignatureXXX-KeyInfo"><ds:X509Data><ds:X509Certificate>87t7878t78t65yyutyutyutyutyutuytvyutyutuytv</ds:X509Certificate></ds:X509Data>
<ds:KeyValue><ds:RSAKeyValue><ds:Modulus>uyu87687v8v67868767866fgfftftftyfytft</ds:Modulus><ds:Exponent>AQAB</ds:Exponent></ds:RSAKeyValue></ds:KeyValue></ds:KeyInfo><ds:Object Id="ook.8888mmmuuguy55454bb"><xades:QualifyingProperties xmlns:xades="http://uri.etsi.org/01903/v1.3.2#" Id="QualifyingProperties-35e50bb6-9e6f-4b33-9334-8abb56fb3953" Target="#SignatureXXX"><xades:SignedProperties Id="xmldsig-SignatureXXX-signedprops"><xades:SignedSignature