-
Notifications
You must be signed in to change notification settings - Fork 314
Add support for providing an AttachmentCallbackHandler to WSS4J RequestData #107
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
Conversation
Wss4J2 SwA signature/encryption support.
@elfogre Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
@elfogre Thank you for signing the Contributor License Agreement! |
Shouldn't this use the MimeMessage API so that it works with both SAAJ and Axiom? |
My first approach was with org.springframework.ws.mime.Attachment instead of SAAJ dependant AttachmentPart . However there is a design problem with org.springframework.ws.mime.Attachment that requires a big change. I'll try to explain:
As I need all attachment mime-headers to be correctly processed in the attachmentCallbackHandler, I can't use Axiom and I have to access javax.xml.soap.AttachmentPart in SAAJ implementation. This is the reason why this callback is only for SAAJ. If we write accesors for mime-header in Attachment interface and in saaj and axiom attachment implementations, we can easily change this CallbackHandler to use SoapMessage API. I can write that code if you think it's useful |
86e5d92
to
4c5bd74
Compare
Thanks for the PR and I apologize for taking this long to review it. We'll add the setter. As for the implementation, I'd rather keep it on your side for now. We can revisit this based on interest from the community. |
Hello Spring-ws comunity,
I'm using spring-ws to develope an AS4 server. Everything works correct (SAAJ + Wss4j2) except when I want to sign/encrypt Soap attachments in a request. When I try it, I get an error:
Wss4j2 needs an attachmentCallbackHandler to work, but it can't be set it via Wss4jSecurityInterceptor. I've add a new field, it's setter and I add a line in initializeRequestData method to set it in the request. After this I could sign without problems attachments in SOAP.
A SAAJ attachmentCallbackHandler implementation with its test is also included in the pull request.