16. Mai 2018 16:10
OnRun-Trigger
...
Window.OPEN(Text1140003);
IF ISCLEAR(ElsterTransferHandlerNavision) THEN
CREATE(ElsterTransferHandlerNavision);
//ElectronicVATDeclSetup und Certificate sind bereits geholt
//Fülle Zwischenvarieblen bzw. Streams
ElectronicVATDeclSetup.CALCFIELDS("Elster Certificate","Client Certificate");
IF NOT ElectronicVATDeclSetup."Elster Certificate".HASVALUE THEN
ERROR(ErrorCertFileMissing,ElectronicVATDeclSetup.FIELDCAPTION("Elster Certificate"),ElectronicVATDeclSetup.TABLECAPTION);
IF NOT ElectronicVATDeclSetup."Client Certificate".HASVALUE THEN
ERROR(ErrorCertFileMissing,ElectronicVATDeclSetup.FIELDCAPTION("Client Certificate"),ElectronicVATDeclSetup.TABLECAPTION);
ElectronicVATDeclSetup."Elster Certificate".CREATEINSTREAM(certStream);
ElectronicVATDeclSetup."Client Certificate".CREATEINSTREAM(ClientCertStream);
ElsterCertSize := ElectronicVATDeclSetup."ElsterCertificate Size";
ClientCertSize := ElectronicVATDeclSetup."Client Certificate Size";
p12Password := ElectronicVATDeclSetup."Client Certificate Password";
Certificate.CALCFIELDS("PFX File");
IF NOT Certificate."PFX File".HASVALUE THEN
ERROR(ErrorCertFileMissing,Certificate.FIELDCAPTION("PFX File"),Certificate.TABLECAPTION);
Certificate."PFX File".CREATEINSTREAM(inpfxStream);
pfxPassword := Certificate."PFX File Password";
//Übertrage die Zertifikate aus dem Stream in den ComWrapper, Einzelzeichenweise.
ElsterTransferHandlerNavision.AllocCertArray(ElsterCertSize);
WHILE NOT certStream.EOS DO BEGIN
certStream.READ(BufferChar);
ElsterTransferHandlerNavision.DripFeedCertArray(BufferChar);
END;
ElsterTransferHandlerNavision.AllocClientCertArray(ClientCertSize);
WHILE NOT ClientCertStream.EOS DO BEGIN
ClientCertStream.READ(BufferChar);
ElsterTransferHandlerNavision.DripFeedClientCertArray(BufferChar);
END;
ElsterTransferHandlerNavision.SetClientCertPassWord(p12Password);
ElsterTransferHandlerNavision.AllocPfxCertArray(Certificate."PFX File Size");
WHILE NOT inpfxStream.EOS DO BEGIN
inpfxStream.READ(BufferChar);
ElsterTransferHandlerNavision.DripFeedPfxCertArray(BufferChar);
END;
ElsterTransferHandlerNavision.SetPfxCertPassWord(pfxPassword);
ElsterTransferHandlerNavision.SetHttpServer(GetServerURL);
// ab hier wieder Standard
XMLRespDoc := ElsterTransferHandlerNavision.SendXmlDocument(XMLSubDoc);
…
ConfigNode.text := CertificateRef;
16. Mai 2018 16:58
3. Juni 2018 10:59
IF ISCLEAR(ElsterTransferHandlerNavision) THEN
CREATE(ElsterTransferHandlerNavision,FALSE,TRUE);
//Round one: get the certificate file sizes for the allocation functions
Certificate."PFX File".CREATEINSTREAM(inpfxStream);
Certificate."Elster Certificate".CREATEINSTREAM(certStream);
Certificate."Client Certificate".CREATEINSTREAM(ClientCertStream);
WHILE NOT certStream.EOS DO BEGIN
certStream.READ(BufferChar);
ElsterCertSize += 1;
END;
WHILE NOT ClientCertStream.EOS DO BEGIN
ClientCertStream.READ(BufferChar);
ClientCertSize += 1;
END;
WHILE NOT inpfxStream.EOS DO BEGIN
inpfxStream.READ(BufferChar);
PFXCertSize +=1;
END;
//Round two: Transfer the certificates and passwords into the COM wrapper
Certificate."PFX File".CREATEINSTREAM(inpfxStream);
Certificate."Elster Certificate".CREATEINSTREAM(certStream);
Certificate."Client Certificate".CREATEINSTREAM(ClientCertStream);
ElsterTransferHandlerNavision.AllocCertArray(ElsterCertSize);
WHILE NOT certStream.EOS DO BEGIN
certStream.READ(BufferChar);
ElsterTransferHandlerNavision.DripFeedCertArray(BufferChar);
END;
ElsterTransferHandlerNavision.AllocClientCertArray(ClientCertSize);
WHILE NOT ClientCertStream.EOS DO BEGIN
ClientCertStream.READ(BufferChar);
ElsterTransferHandlerNavision.DripFeedClientCertArray(BufferChar);
END;
ElsterTransferHandlerNavision.SetClientCertPassWord(p12Password);
ElsterTransferHandlerNavision.AllocPfxCertArray(PFXCertSize);
WHILE NOT inpfxStream.EOS DO BEGIN
inpfxStream.READ(BufferChar);
ElsterTransferHandlerNavision.DripFeedPfxCertArray(BufferChar);
END;
ElsterTransferHandlerNavision.SetPfxCertPassWord(pfxPassword);
// Finally call the transfer function (.net 4.5.2)
RespText :=
ElsterTransferHandlerNavision.SendXmlDocumentString(TransferDoc.OuterXml);
27. Juni 2018 10:03
27. Juni 2018 13:21
29. Juni 2018 09:12
29. Juni 2018 10:41
attrib -R *.tlb
gacutil.exe /i interop.MSXML6.dll
gacutil.exe /i Microsoft.Dynamics.ElsterTransferHandler.dll
gacutil.exe /i Microsoft.Dynamics.ElsterTransferHandler.ComWrapper.dll
regasm.exe /tlb:Microsoft.Dynamics.ElsterTransferHandler.ComWrapper.tlb Microsoft.Dynamics.ElsterTransferHandler.ComWrapper.dll
13. November 2018 13:05
13. November 2018 13:41