on 10-26-2006 7:10 PM
Hi!
My problem: I get an email with an attachment which I process in an adapter module for the mail adapter. With the resulting XML I set a new payload, but the old attachment still exists.
This gets to a problem when I route the message back to the mail adapter, he adds the old attachment to the generated email. Therefore the new email has two attachments: the old one and the new one, which should only be one attachment: only the new one.
How can I remove the old attachment? I found no function which solves this problem.
Best regards,
Daniel
Hi,
why don't you delete the attachment in the adapter module
before adding the new one?
Regards,
michal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michal,
that is the point I haven't yet found the way I can delete the old attachment. I searched something like msg.removeAttachment(attachmentName) or msg.removeAllPayload(), but I found nothing which seems to be usefull for this.
I have the feeling, that it is easy to solve, but I can't see the solution
Best regards,
Daniel
hi,
removeAttachment method:
http://help.sap.com/saphelp_nw04/helpdata/en/9a/945e3026760745a751a85499139c7c/content.htm
but I see it only on help.sap.com
I don't see the method in my API (sp17) strange
do you see it ?
Regards,
michal
Hi Michal,
thanks for the link.
When I import aii_proxy_xirt.jar in my NWDS, I can import the MessageSpecifier class. But I can't get an instance of it from the classes which I can access.
The only 'documented' usages of this class I found were codings for java proxies, so I'm not sure we can use this class in an adapter module.
In this cases they get the MessageSpecifier instance from the proxy bean, so maybe we can get it from the EJB, but this doesn't work with an adapter module (or I haven't found out how )
Hmm. It is a simple problem, but it seems difficult to solve
Best regards,
Daniel
Message was edited by: Daniel Himmel
Hi Daniel,
I found this in the api documentation ( included in the sample_ra.jar file as demo for building your own adapter ) :
"The Message interface defines several methods for applications to deal with payloads:
-Factory methods to create an empty payload of a specific type.
-Add a payload to the message.
-Get a payload by name or interat over the payloads of a message.
Once a payload is added to the Message, it can not be removed again. To do that, a new Message has to be created and populated with the new payloads."
( and I bumped into this thread while trying to find out if its possible to get access to a messagespecifier interface from an adapter module...)
rgds
Dirk
Hi all,
thanks for the information. I "solved" the problem by perfoming a message split. When a message split is performed, new messages are generated out of the source message and all attachments are dropped. Then I route one of the duplicated messages to the adapter which I need and the other message to the fileadapter which writes it to the filesystem to get rid of the unneeded second message.
That is only a workaround, because I get three messages instead of one, but the only solution I see at the moment. Maybe a function to remove existing attachments would be a nice feature for a future support package?
Best regards,
Daniel
This might be of some help -
http://help.sap.com/saphelp_nw04/helpdata/en/2e/bf37423cf7ab04e10000000a1550b0/frameset.htm
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.