ebMS <eb:Role> elements

127 views
Skip to first unread message

Albert

unread,
Jun 8, 2007, 8:54:54 AM6/8/07
to Hermes 2.0 Discussion List
Hello,

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

Twinsen

unread,
Jun 13, 2007, 12:57:36 PM6/13/07
to Hermes 2.0 Discussion List
Hi 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

Reply all
Reply to author
Forward
0 new messages