Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Preguntas técnicas, códigos, esquemas, envíos,... (https://www.clubdelphi.com/foros/forumdisplay.php?f=87)
-   -   CancelInvoice - Error Interno (https://www.clubdelphi.com/foros/showthread.php?t=98108)

JoseLeeTo 17-11-2026 13:04:03

CancelInvoice - Error Interno
 
Buenos días,

¿Alguien ha podido enviar una factura de cancelación\anulación CancelInvoice al entorno de pruebas?.

Si tuviese la amabilidad de poner el Soap, para ver los datos que se remiten (y comparar el CollaborationInfo" y el "Service" del Soap), le estaría muy agradecido, ya que por alguna razón siempre me devuelve "Error interno".

Muchas gracias de antemano.

jlmoli_67 17-11-2026 19:51:36

hola.
a ver si te sirve

Código:

------=_Part_e09990a9e20b400b80079772f8f5afc7
Content-Type: application/soap+xml; charset=UTF-8
Content-Transfer-Encoding: 8bit

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:eb3="http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/"><soapenv:Header><eb3:Messaging soapenv:mustUnderstand="1"><eb3:UserMessage><eb3:MessageInfo><eb3:Timestamp>2026-11-17T17:37:20.798Z</eb3:Timestamp><eb3:MessageId>uuid-ee1e06dc-55d4-41e0-a4c5-89787d4127ed</eb3:MessageId></eb3:MessageInfo><eb3:PartyInfo><eb3:From><eb3:PartyId type="urn:oasis:names:tc:ebcore:partyid-type:iso6523:9920">nif autorizado</eb3:PartyId><eb3:Role>ebms:initiator</eb3:Role></eb3:From><eb3:To><eb3:PartyId type="urn:oasis:names:tc:ebcore:partyid-type:iso6523:9920">Q2826000H</eb3:PartyId><eb3:Role>ebms:responder</eb3:Role></eb3:To></eb3:PartyInfo><eb3:CollaborationInfo><eb3:Service>urn:cen.eu:en16931:cancelinvoice</eb3:Service><eb3:Action>CANCELINVOICE</eb3:Action><eb3:ConversationId>1345b0c7-cb03-4c9f-a2b1-53493e06adc5</eb3:ConversationId></eb3:CollaborationInfo><eb3:PayloadInfo><eb3:PartInfo href="cid:CancelarFact.xml"><eb3:PartProperties><eb3:Property name="MimeType">application/xml</eb3:Property></eb3:PartProperties></eb3:PartInfo></eb3:PayloadInfo></eb3:UserMessage></eb3:Messaging></soapenv:Header><soapenv:Body/></soapenv:Envelope>
------=_Part_e09990a9e20b400b80079772f8f5afc7
Content-Type: application/xml; charset=UTF-8
Content-ID: <CancelarFact.xml>
Content-Transfer-Encoding: 8bit

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ApplicationResponse xmlns="urn:oasis:names:specification:ubl:schema:xsd:ApplicationResponse-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><cbc:ID>VOID-20261117-8595</cbc:ID><cbc:IssueDate>2026-11-17</cbc:IssueDate><cac:SenderParty></cac:SenderParty><cac:ReceiverParty></cac:ReceiverParty><cac:DocumentResponse><cac:Response><cbc:ResponseCode>CANCELINVOICE</cbc:ResponseCode><cbc:Description>Anulacion por error en emision sin transaccion real</cbc:Description><cbc:EffectiveDate>2026-10-05</cbc:EffectiveDate></cac:Response><cac:DocumentReference><cbc:ID>CLASEA00000185</cbc:ID><cbc:IssueDate>2026-10-05</cbc:IssueDate><cbc:DocumentType>Invoice</cbc:DocumentType><cac:IssuerParty><cac:PartyTaxScheme><cbc:CompanyID>nif autorizado</cbc:CompanyID><cac:TaxScheme/></cac:PartyTaxScheme><cac:PartyLegalEntity><cbc:RegistrationName>nombre del autorizado</cbc:RegistrationName></cac:PartyLegalEntity></cac:IssuerParty></cac:DocumentReference></cac:DocumentResponse></ApplicationResponse>
------=_Part_e09990a9e20b400b80079772f8f5afc7--


JoseLeeTo 18-11-2026 11:38:11

CancelInvoice - Error Interno
 
Muchas gracias por el ejemplo.
Miro a ver qué tengo diferente, y pruebo.

Un saludo

JoseLeeTo 18-11-2026 17:49:03

CancelInvoice - Error Interno.
 
Buenas de nuevo.

Sigue dándome error interno, y no doy con ello. Me está volviendo loco.
No sé si tiene que ver con la generación de las clases en c# o qué.

Algo que sí he visto, es que en la documentación especifica que la factura a anular, estará en ApplicationResponse/cac: DocumentResponse/cac: Response/cac: DocumentReference

Pero al mapear los .xsd de UBL2.5 de GitHub, dentro de "cac: Response", no existe ningún tipo "cac: DocumentReference". Algo que sí que existe, pero dentro de "cac: DocumentResponse" pero no dentro de "cac: Response". (Hablo del mapeo directo de clases, sin usar la implementación de wsdl).

He añadido el tipo cac:DocumentReference dentro de cac:Response, lo he informado, y me sigue dando el mismo error: "Error interno"

jlmoli_67, ¿Te importaria poner un ejemplo del xml de CANCELINVOICE con datos ficticios?

Muchas gracias

jlmoli_67 18-11-2026 19:41:55

Envio peticion CANCELINVOICE completo
 
Buenas,

A ver si te sirve. solo he quitado mi nombre y cif el resto esta tal cual.

No te preocupes que a las malas te paso el modulo de cancelar (yo tambien trabajo en .net aunque algo antiguo el framework)

Código:

**********************************
soap que se  envia
**********************************

------=_Part_8b104c3f639d484db914ab05f0cff449
Content-Type: application/soap+xml; charset=UTF-8
Content-Transfer-Encoding: 8bit

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:eb3="http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/"><soapenv:Header><eb3:Messaging soapenv:mustUnderstand="1"><eb3:UserMessage><eb3:MessageInfo><eb3:Timestamp>2026-11-18T17:19:03.166Z</eb3:Timestamp><eb3:MessageId>uuid-d1b7de57-6612-4385-93fe-ae3fa22dab16</eb3:MessageId></eb3:MessageInfo><eb3:PartyInfo><eb3:From><eb3:PartyId type="urn:oasis:names:tc:ebcore:partyid-type:iso6523:9920">nif emisor(*******)</eb3:PartyId><eb3:Role>ebms:initiator</eb3:Role></eb3:From><eb3:To><eb3:PartyId type="urn:oasis:names:tc:ebcore:partyid-type:iso6523:9920">Q2826000H</eb3:PartyId><eb3:Role>ebms:responder</eb3:Role></eb3:To></eb3:PartyInfo><eb3:CollaborationInfo><eb3:Service>urn:cen.eu:en16931:cancelinvoice</eb3:Service><eb3:Action>CANCELINVOICE</eb3:Action><eb3:ConversationId>99c0f826-25b3-4407-968a-8caf1b961a73</eb3:ConversationId></eb3:CollaborationInfo><eb3:PayloadInfo><eb3:PartInfo href="cid:CancelarFact.xml"><eb3:PartProperties><eb3:Property name="MimeType">application/xml</eb3:Property></eb3:PartProperties></eb3:PartInfo></eb3:PayloadInfo></eb3:UserMessage></eb3:Messaging></soapenv:Header><soapenv:Body/></soapenv:Envelope>
------=_Part_8b104c3f639d484db914ab05f0cff449
Content-Type: application/xml; charset=UTF-8
Content-ID: <CancelarFact.xml>
Content-Transfer-Encoding: 8bit

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ApplicationResponse xmlns="urn:oasis:names:specification:ubl:schema:xsd:ApplicationResponse-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><cbc:ID>VOID-20261118-13377187</cbc:ID><cbc:IssueDate>2026-11-18</cbc:IssueDate><cac:SenderParty></cac:SenderParty><cac:ReceiverParty></cac:ReceiverParty><cac:DocumentResponse><cac:Response><cbc:ResponseCode>CANCELINVOICE</cbc:ResponseCode><cbc:Description>Anulacion por error en emision sin transaccion real</cbc:Description><cbc:EffectiveDate>2026-10-05</cbc:EffectiveDate></cac:Response><cac:DocumentReference><cbc:ID>FAC202600007</cbc:ID><cbc:IssueDate>2026-10-05</cbc:IssueDate><cbc:DocumentType>Invoice</cbc:DocumentType><cac:IssuerParty><cac:PartyTaxScheme><cbc:CompanyID>nif emisor(*******)</cbc:CompanyID><cac:TaxScheme/></cac:PartyTaxScheme><cac:PartyLegalEntity><cbc:RegistrationName>nombre del emisor(*********)</cbc:RegistrationName></cac:PartyLegalEntity></cac:IssuerParty></cac:DocumentReference></cac:DocumentResponse></ApplicationResponse>
------=_Part_8b104c3f639d484db914ab05f0cff449--


******************************************************
documento XML del ApplicationResponse (lo que quiero anular)
*****************************************************

<ApplicationResponse>
<cbc:ID>VOID-20261118-13377187</cbc:ID>
<cbc:IssueDate>2026-11-18</cbc:IssueDate>
<cac:SenderParty/>
<cac:ReceiverParty/>
<cac:DocumentResponse>
<cac:Response>
<cbc:ResponseCode>CANCELINVOICE</cbc:ResponseCode>
<cbc:Description>
Anulacion por error en emision sin transaccion real
</cbc:Description>
<cbc:EffectiveDate>2026-10-05</cbc:EffectiveDate>
</cac:Response>
<cac:DocumentReference>
<cbc:ID>FAC202600007</cbc:ID>
<cbc:IssueDate>2026-10-05</cbc:IssueDate>
<cbc:DocumentType>Invoice</cbc:DocumentType>
<cac:IssuerParty>
<cac:PartyTaxScheme>
<cbc:CompanyID>nif emisor(*******)</cbc:CompanyID>
<cac:TaxScheme/>
</cac:PartyTaxScheme>
<cac:PartyLegalEntity>
<cbc:RegistrationName>nombre del emisor(*********)</cbc:RegistrationName>
</cac:PartyLegalEntity>
</cac:IssuerParty>
</cac:DocumentReference>
</cac:DocumentResponse>
</ApplicationResponse>



La franja horaria es GMT +2. Ahora son las 21:29:28.

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