For interoperability with another ebMS product, which supports CPA,
there is a need to use the <eb:Role> elements inside the <eb:From> and
<eb:To> elements when sending messages.
The <eb:Role> is used to lookup a matching CollaborationRole in the
CPA.
Is it possible to extend the Sender Service, for an application to
request Hermes to send an ebMS message, to be able to specify the
fromPartyRole and toPartyRole?
Best regards, Albert
You can do the following steps to achieve what you
want to do:
1. Modify the EbmsMessageSenderService.java in EbMS plugin.
2. Add web service parameters "fromRole" and "toRole" for external to
set the ebms from/to role. Extract them in the SenderService by adding
codes shown below:
String fromRole = getText(bodies, "fromRole"); <-- add this.
String toRole = getText(bodies, "toRole"); <-- add this
Add the above two code after Element [] bodies =
request.getBodies();
3. Set the from/to role after adding the corresponding party id shown
below:
for (int i = 0; i < fromPartyIds.length; i++) {
msgHeader.addFromPartyId(fromPartyIds[i], fromPartyTypes[i]);
}
msgHeader.setFromRole(fromRole); <-- add this
for (int i = 0; i < toPartyIds.length; i++) {
msgHeader.addToPartyId(toPartyIds[i], toPartyTypes[i]);
}
msgHeader.setToRole(toRole); <-- add this
4. Recompile the EbMS plugin as SPA and put it back in the H2O plugin
folders.
5. Finish ! Now the sender service should able to set the ebms role
when the connected application provide two extra parameters "fromRole"
and "toRole" when invocating the sender web service.
6. Enjoy!
Regards,
Twinsen