Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Подписание и отклонение документа XmlAcceptanceCertificate #279

Open
GrachevEA opened this issue Jan 23, 2024 · 4 comments

Comments

@GrachevEA
Copy link

Столкнулся с проблемой подписания документа с типом XmlAcceptanceCertificate.

Общая информация по документу :

EntityType: Attachment EntityId: "08dd8d9d-ff2b-43a8-a36c-6920bad580a6" Content { Size: 3807 } AttachmentType: XmlAcceptanceCertificate FileName: "DP_REZRUISP_2BM-9679387467-967901000-201509141254127128738_2BM-9612437724-961201000-201509141253018309040_20230225_62d78382-feb6-422c-a7cc-196df400d15e.xml" DocumentInfo { MessageId: "ac8feb6c-7dff-4875-8b09-9492c25041bb DocumentType: XmlAcceptanceCertificate Content { Size: 3807 } FileName: "DP_REZRUISP_2BM-9679387467-967901000-201509141254127128738_2BM-9612437724-961201000-201509141253018309040_20230225_62d78382-feb6-422c-a7cc-196df400d15e.xml" XmlAcceptanceCertificateMetadata { DocumentStatus: InboundWaitingForRecipientSignature } DocumentDirection: Inbound TypeNamedId: "XmlAcceptanceCertificate" Version: "rezru_05_02_01"

Документ находится в статусе "Требуется подпись"

при формировании обращения пытался ориентироваться на документацию, но уперся в ошибку "400, reason phrase: Invalid data UserContractData:
Data at the root level is invalid. Line 2, position 1."

diadocApi.GenerateTitleXml(
boxId,
"XmlAcceptanceCertificate",
"default",
entity.getVersion(),
0,
true,
null,
packageId, entity.getEntityId(),
AcceptanceCertificateInfoProtos.AcceptanceCertificateSellerTitleInfo.newBuilder()
.setSeller(OrganizationInfoProtos.DiadocOrganizationInfo.newBuilder()
.setOrgInfo(OrganizationInfoProtos.OrganizationInfo.newBuilder()
.setName(organization.getShortName())
.setAddress(organization.getAddress())
.build())
.build())
.setBuyer(OrganizationInfoProtos.DocflowParticipant.newBuilder().getDefaultInstanceForType())
.setDocumentDate(new SimpleDateFormat("dd.MM.yyyy").format(new Date()))
.setDocumentTitle(entity.getFileName())
.setSigner(SignerProtos.Signer.newBuilder()
.setSignerDetails(SignerProtos.SignerDetails.newBuilder()
.setFirstName(certificateDAO.getFirstName())
.setSurname(certificateDAO.getLastName())
.setInn(certificateDAO.getInn())
.build())
.build())
.setSignature(AcceptanceCertificateInfoProtos.AcceptanceCertificateSignatureInfo.newBuilder()
.setSignatureDate(new SimpleDateFormat("dd.MM.yyyy").format(new Date()))
.setOfficial(OfficialProtos.Official.newBuilder()
.setFirstName(certificateDAO.getFirstName())
.setSurname(certificateDAO.getLastName())
.build())
.build())
.build().toByteArray())

Если ставить titleIndex = 1 ответ становится "status code: 400, reason phrase: Parameters letterId and documentId should be presented when titleIndex=1". Может кто-то объяснить, что значат обе ошибки, какие параметры передаются не правильно (что должно быть в documentId / letterId) или какие способы подписания данного типа документа существует (быть может через устаревшие методы - GenerateRecipientTitleXml...)

@GrachevEA
Copy link
Author

@PhilMeshkovo

@GrachevEA
Copy link
Author

@RusB

@GrachevEA
Copy link
Author

@foobarbazmeow, @asvyazin, @ak3n, @atytsky

@atytsky
Copy link
Contributor

atytsky commented Jan 30, 2024

/cc @AnatoliDubko @Rispele @ShineTear

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants