on 08-06-2015 8:33 PM
Hi Experts,
My scenario is to get Order Confirmations with multiple attachments from Ariba, when Dat Request is sent to Ariba all the pending Order confirmations are sent as an attachment.
I am using SOAP Receiver adapter to get the pending Order confirmations with Keep Attachments and Do Not Use SOAP Envelope parameters.
Payload contains MainAttachment and multiple attachments attachment-2, attachment-3, attachment-3....
Also I am using Payload Swap Bean - AF_Module/PayloadSwapBean with following parameters after standard SOAP adapter module,
swap.keyName: payload-name
swap.keyValue: attachment-2
I am able to swap MainAttachment with attachment-2 but I have following issues,
Please guide on what changes can be done in PayloadSwapBean so that all the attachments are swappend in payload with entire content.
Let me know if there is any other approach can be adapted to meet the above requirement.
Thanks and Best Regards,
Nitin Patil
Hi Nitin,
Do you have any specific reason to go for SOAP adapter instead of standard ARIBA adapter for connecting to ARIBA?
Your requirement is very simple to handle when you go with standard ARIBA adapter which has in built features to handle this scenario.
Regards
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Venkat,
Customer is not willing to purchase Ariba Network Adapter because of budget constraints and want us to implement using the existing PI capabilities.
Can you please let me know if you have any idea on how to correct the above error or any other way for handling multiple attachments?
Thanks!
Regards,
Nitin Patil
the mapping api now supports the reading of attachments using java code
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shabarish/Experts,
thanks for your help, However I was unable to find java code details in one of the link you had provided but somehow was able to manage Java code.
Currently using Java mapping and trying to load the attachments in payload and store it on to the server using FilePath parameter in Java code.
FilesPath parameter is is defined in Operation Mapping and parameter is passed through the Interface determination but at runtime parameter is not passed from configuration. Also below are the screenshot of error and configuration in operation mapping and interface determination for your reference.
<!-- Request Message Mapping -->
</SAP:Error>
Operation Mapping:
Interface Determination:
Part of Java code for your reference,
/*Reading parameter File Path of application server where files are to be downloaded from parameter given in Iflow configuration*/ | ||||||||
String FilesPath = arg0.getInputParameters().getString("FilesPath"); | ||||||||
getTrace().addInfo(String.valueOf(arrayObj.length)); | ||||||||
if(arrayObj.length == 0) | ||||||||
{ | ||||||||
throw new RuntimeException("No Attachments Available"); | ||||||||
} | ||||||||
for(int i =0;i<arrayObj.length;i++) | ||||||||
{ | ||||||||
attachmentID =(String)arrayObj[i]; | ||||||||
Attachment attachment = inputAttachments.getAttachment(attachmentID); | ||||||||
String attchName = attachment.getContentType(); | ||||||||
if(attchName.indexOf("\"") != -1) | ||||||||
{ | ||||||||
attchName = attchName.substring(attchName.indexOf("\"")); | ||||||||
attchName = attchName.replaceAll("\"",""); | ||||||||
} | ||||||||
//if (attchName.substring(attchName.length()-3).equals("xml")) | ||||||||
//Above if statement is on case to check the attachment with extnsion{ | ||||||||
/* below lines for downloading the XML attachments content to FilePath location with the name retrieved from attachment*/ | ||||||||
try | ||||||||
{ | ||||||||
byte[] attachmentBytes = attachment.getContent(); | ||||||||
File path = new File(FilesPath+attchName); | ||||||||
FileOutputStream fos = new FileOutputStream(path); | ||||||||
fos.write(attachmentBytes); | ||||||||
while(!isCompletelyWritten(path)); | ||||||||
} | ||||||||
catch(IOException IOE) | ||||||||
{ | ||||||||
StreamTransformationException STE = new StreamTransformationException(IOE.getMessage(),IOE); | ||||||||
STE.setStackTrace(IOE.getStackTrace()); | ||||||||
throw STE; | ||||||||
} |
Please help.
Regards,
Nitin Patil
Did you create the binding? Pt:5
Parameterized Java Mappings - Enterprise Services Repository - SAP Library
don't wait for this, first do an end-end to test by hard-coding the value in java code.
We have several SAP notes reg paramterized mapping. You can look for them and see if any of them are applicable to your installation.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
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.