cancel
Showing results for 
Search instead for 
Did you mean: 

HTTP_AAE Receiver adapter + MIME, How to use it?

nitinlpatil12
Participant
0 Kudos

H Experts,

I have a scenario in which I am sending Data Request to Ariba for Order Confirmation Request and supposed to get Data Response document with MIME envelope.

In HTTP_AAE Receiver Adapter I have used following Request Details parameters,

Set Multipart - checked

Keep Attachments - checked

Specify Content Details - checked

     Character Encoding: charset=ISO-8859-1

     Content Type: multipart/mixed

I am getting following error in Data Response in both cases when I have above parameters checked or not. In the response I am expecting multiple attachments with various content type: text/xml; application/pdf; multipart/mixed.

Please let me know what to use in above parameters which will help in y scenario, Any details will be highly appreciated.

Regards,

Nitin Patil

Accepted Solutions (1)

Accepted Solutions (1)

nabendu_sen
Active Contributor
0 Kudos

Hi Nitin,

I really don't think this is a PI issue as per your requirement. Ariba has sent back this error.

But if Ariba is also expecting data of MIME type. You should use SOAP Adapter with 'Do not use SOAP envelope' and 'Keep attachments'.

You can check the below thread:

PO attachment via CXML to Ariba | SCN

Regards,

Nabendu.

nitinlpatil12
Participant
0 Kudos

Hi Nabendu/Experts,

SOAP envelope worked and I am able to receive the Payload and attachments from Ariba.

Could you please let me know how to pass on this Payload and attachments to legacy system as a attachments or mapping in XML at runtime...no clue for me how can I achieve this?

Thanks for your help.

Regards,

Nitin Patil

nabendu_sen
Active Contributor
0 Kudos

Hi Nitin,

Please check:

If you want to convert the attachment to SOAP Body, use PayLoadSwapBean module.

Regards,

Nabendu.

nitinlpatil12
Participant
0 Kudos

Hi Nabendu/Experts,

I was able to convert attachment to SOAP body using AF_Module/PayLoadSwapBean

Parameters used:

swap-keyName: payload-name

swap.keyValue: attachment-2

and attachment-2 was swap as apayload and ns0 was appended in all the tags and I was able to identify it as a payload.

However, I have multiple attachments in a SOAP response and even if I pass multiple swap.keyValue, Module considers the latest one. I was wondering how can I pass all the attachments as a payload, so that all the attachments are considered and nothing gets dropped out?

Regards,

Nitin Patil

nitinlpatil12
Participant
0 Kudos

Hi Nabendu/Experts,

I am unable to achieve multiple attachment transfer to payload using Payload SwapBean.

Now I am using Java mapping and trying to load the attachments in payload and store it on to the server using FilePath parameter.

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 for operation mapping and interface determination for your reference.

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;
           }

Regards,

Nitin Patil

Answers (0)