on 11-03-2005 8:59 AM
Hi,
anyone knows how can we add an attachment
to the XI message so that later on
we can use PayloadSwapBean to send it somewhere
with the standard XML message?
can we do it in the mapping step?
(in what kind of mapping?)
Regards,
michal
Hi Michal,
I guess we can add attachment in module since we get full saop message there.
In mapping program, i doubt it as it gives access to payload only, not the whole SOAP message.
Hope the following code from a document How to create Adaptermodule can help.
// create a second attachment for the receiver mail adapter
try {
// get the XI message from the environment
Message msg = (Message)
inputModuleData.getPrincipalData();
// create a new payload
TextPayload attachment = msg.createTextPayload();
// provide attributes and content for the new payload
attachment.setName("Attachment");
attachment.setContentType("text/plain");
attachment.setText("Hello World");
// add the new payload as attachment to the message
msg.addAttachment(attachment);
// provide the XI message for returning
inputModuleData.setPrincipalData(msg);
} catch (Exception e) {
// raise exception, when an error occurred
ModuleException me = new ModuleException(e);
throw me;
Regards,
Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.