upgrade to phase4 - entsog profile troubles #272
Unanswered
mrotaru-20
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Wow, okay, that sounds like an interesting topic.
Than start adding phase4. And then I strongly recommend to use the builder based approach instead of fiddling with the message native layouts and the http transision manually.... |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
I have to upgrade a legacy app to
phase4-lib
usingentsog
profile.But the apps use an httpclient-4.514.jar for sending the mime-message, I'm stack at HttpPost when I have to set mimeMessageEntity:
i.e.
httpPost.setEntity(HttpMimeMessageEntity.create(mime))
Certainly got a
'java.lang.ClassCastException: class com.helger.phase4.http.HttpMimeMessageEntity cannot be cast to class org.apache.http.HttpEntity'
Does anyone have recommendations how to upgrade the client to be compatible with phase4-lib API?
The entity set works better with
org.apache.hc.client5.http.classic.methods.HttpPost
but this change generate further issues i.e HttpResponse.i.e.
aBuilder.getParts ().add (new WSEncryptionPart (MessageHelperMethods.PREFIX_CID + "Attachments", "Content"));
then I've got an exception:
Exception was org.apache.wss4j.common.ext.WSSecurityException: http://docs.oasis-open.org/wss/oasis-wss-SwAProfile-1.1#Attachment-Content-Signature-Transform algorithm and DOM mechanism not available
I checked the org.apache.wss4j.dom.message.WSSecSignatureBase.addReferencesToSign(WSSecSignatureBase.java:220 API and it looks for me it is end of road, I have to discontinue using WSEncryptionPart with cid:Attachments as id.
I picked the model from https://useof.org/java-open-source/com.helger.phase4.attachment.WSS4JAttachmentCallbackHandler section: _the class AS4Signer method createSignedMessage.
I'm really grateful if anyone have an advice how to use phase4-lib for entsog profile. Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions