OxalisCommunity/oxalis

Get sending provider out of receipt not possible

Closed this issue · 8 comments

We try to collect data for the Peppol Transactions Reporting.
For outgoing messages we can get the CertSubjectCN out of the public key in the MDN in the RECEIPT.
But for incoming messages the public key is lacking in the MDN.
How can we get to know the SP-id of the Sender?

We are using Oxalis v5.

As mentioned in Wiki - https://github.com/OxalisCommunity/oxalis/wiki/Peppol-Reporting-%E2%80%90-WIP you can retrieve
“C2SeatID” for incoming message as below:

“C2SeatID”: Peppol Seat ID of C2 – “For outgoing (sending), C2SeatID can be extracted from the CN of the Peppol Service Provider certificate used for signing the AS4 message and for incoming (receiving), C2SeatID can be deduced from the Peppol signing certificate that is part of the received AS4 message (X.509 Certificate Subject CN value)” – Column/Field used in TSR only

Sender/“C2SeatID” for incoming message can retrieve from inboundMetadata something like below:

String c2SeatID= inboundMetadata.getCertificate() != null ? CertificateUtils
.extractCommonName(inboundMetadata.getCertificate()) : "";

Ah, so we will need to make a plugin for that to get this data field?
All other data can be extracted of the SBDH/receipt.

Everything required is there in inboundMetadata, whether it is protocol, timestamp, certificate or header object etc...

Yes, I understand Aaron, but we are not a Java-specialist. That's why we try to use the allready present data.
I guess you can give us a hint to documentation how to write a plugin? Maybe some template?

Found a solution using CertificateUtils.extractCommonName(transmissionResponse.getEndpoint().getCertificate()) after sending a file.
Couldn't get the statistics-plugin working.

Hi @PPotappel,
did you write a plugin to retrieve the data in the end or did you manage otherwise? I'm having the exact same problem, hoping you point me in the right direction :)

Well Fabian.
We downloaded the code, added the needed code to DefaultPersister.java and TransmissionTask.java, and than rebuild all.
This is working, but far from ideal, as we need to do this every time a new version of Oxalis is released.
Plugin is the way to go, but we were not able to get that working.

Thank you for answering, that may have to be what we're doing, at least to be able to do any reporting. If you'd like, I can message you if we come up with a "share-worthy" solution.