on 07-15-2008 1:51 PM
Hi All,
I am working on a scenario where in I recieve the Payload from a web service.The payload consists of 2 parts one is the xml document and the second is the attachment (image,PDF,..).When I monitor the messages in sxmb_moni I find 2 payloads as shown below.
Payloads
attachment-1 ( image/jpeg )
MainDocument ( text/xml;charset=utf-8 )
I have a file server on the reciever side and I want 2 files to be created on the target side i.e., one the xml file and the second the attachment.
Can anyone help me how can I handle the 2 payloads either in mapping or during configuration.
Is it possible to handle the attachments in mapping(XSLT or Java) and how?
Thanks in advance.
Vikram
The SOAP Axis receiver adapter can handle multiple file attachments.
You cannot map the attachment in 3.0/7.0 (you can in 7.1), you can only map the main document.
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vikram,
I believe you can achieve this requirement by using Java mapping and Multi-Mapping techniques.
1. Create 2 target Message Types a] Message type for Original payload (for Eg. MsgType1) b] Message type for Binary Attachment data (for Eg. MsgType2)
2. In Interface mapping include 2 target messages MsgType1 and MsgType2
3. Make MsgType1 occurrence as 1 and MsgType2 occurrence as 0 to Unbounded
4. Write a Java mapping to generate the Multi-Mapping payload with one Message for MsgType1 and 0 or more messages for MsgType2.
5. Java mapping program has to utilize Message interface functions
getAttachmentIterator()
from com.sap.engine.interfaces.messaging.api.Message
and generate the Binary payload for MsgType2.6. Configure one file adapter for main payload (MsgType2) and one more for Binary payload (MsgType2)
Hope this helps.
Regards,
Ananth
Thank you Ananth.
This is what I have done in my scenario.I have used 2 msg types and used multimapping to map the main document and the attachment saperately.I am struck up while writing java code for implementing java mapping to split the payload into 2 parts and map it accordingly.
Can you help me writing the java code to implement this.
Thanks in advance,
Vikram
Hi,
I think Stefen Grube is correct. Looks like we can't solve your problem using Java mapping if you are in XI 3.0 / PI 7.0 because you can't access payload attachments from mapping programs. But PI 7.1 has new set of API's which enables you to access the payload attachments from Mapping programs..[PI 7.1 Java Mapping API -InputAttachments- Contains methods to read the attachments of the XI message in the mapping|https://help.sap.com/javadocs/pi/SP3/xpi/com/sap/aii/mapping/api/InputAttachments.html]
Regards,
Ananth
Edited by: Ananth Chinnaraj on Jul 17, 2008 2:45 AM
User | Count |
---|---|
87 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.