Forum Stats

  • 3,780,685 Users
  • 2,254,424 Discussions
  • 7,879,412 Comments

Discussions

Ariba Integration with SOA Suit12c

1005818
1005818 Member Posts: 46
edited Sep 7, 2017 8:27PM in SOA & Process Management

Hi All,

We need to integrate SAP Ariba to SOA SUit 12c. Here Ariba is exposed as HTTPS service and when we call it, we get payload in xml format as response. However, Ariba response payload is in base64Encoded. After decoding this, we'll get it in .zip file which contains .csv files. we nee to process these files and push it to ERP E-Biz base tables and vice versa is also a requirement.

Can you please a design patter for this?

Are there any utility services available in BPEL for encoding and decoding base64?

How can we handle this kind of scenario in SOA Suit.

Please note we don't want to use Ariba Cloud adapter for this purpose.

Thanks in advance

Tagged:
leviya

Answers

  • AnatoliAtanasov
    AnatoliAtanasov Member Posts: 883 Silver Trophy
    edited Jul 20, 2017 8:31AM

    I believe there is more than one approach for handling this issue, but here is how I would try to address the requirements:

    1. Create a composite that just calls Ariba, gets the response and makes the csv file ready for processing (by unzipping to a folder)

    2. Create a different composite that processes the CSV files.

    To your question on the Base64 decoding, there is nothing that you can use out-of-the-box. You should use Java activity or custom developed XPath function. For the former scenario you can check this blogpost - Oracle SOA / Java blog: Base64Encode and Base64Decode in BPEL

    Can you paste the Ariba response payload just to have a look at it?

  • Pradosh Kumar Prusty
    Pradosh Kumar Prusty Member Posts: 4
    edited Aug 30, 2017 3:01AM

    As you mentioned you are using SOA 12c and if you have also the MFT 12c license , you can use MFT for unzipping and processing it .

    This is how i would have done this use case.

    1. Create a SOA composite to call the Ariba Web service and then base64Decode the response content to get the zip file .As Anatoli mentioned , there is nothing out of the Box in BPEL to base64Decode it , rather use a simple Java Embedding activity to decode your response .

    Here is a sample snippet of the base64 Decode.

    Add the following 2 lines in your .BPEL file  (importing the Java class required for base64Decode)

    <import location="oracle.xml.parser.v2.XMLElement" importType="http://schemas.oracle.com/bpel/extension/java"/>

    <import location="oracle.soa.common.util.Base64Decoder" importType="http://schemas.oracle.com/bpel/extension/java"/>

    This is a sample Java Embedding snippet to extract the Response payload and base64Decode and assign it to a BPEL variable

    XMLElement EncodedData = (XMLElement)getVariableData("Invoke_Ariba_OutputVariable","parameters","/ns2:AribaResponse/ns2:AribaReturn/ns2:reportBytes");                                    

                                                                          

    String EncodedContent=EncodedData.getTextContent();                                         

                                  

    oracle.soa.common.util.Base64Decoder B64Decoder = new oracle.soa.common.util.Base64Decoder();                                                            

    try                                                            

                                  

    {                                                            

                                 

    String DecodedContent= B64Decoder.decode(EncodedContent);            

             

    addAuditTrailEntry("Data is "+DecodedContent);                             

    setVariableData("DecodedContentVar",DecodedContent);      // Set BPEL Variable DecodedContentVar  This is a String Type                                                   

                                  

    }                                                            

                                  

    catch(Exception e)                                                            

                                  

    {                                                            

      addAuditTrailEntry("Exception During Decode "+e.getMessage());                                                          

      e.printStackTrace();                                                            

                                  

    }

    2. Use a File or FTP adapter to write the zip content into a directory

    3. Create a MFT Transfer (Source as the directory where you have written the zip file ) and Target as a SOA composite which will get the unzipped files and process it

        In MFT transfer , put the "Decompress" pre-processing activity to unzip the files .

        This way you will avoid writing custom unzip program in SOA .

    4. If you do not have the MFT license , then you can use the File or FTP adapter Pipeline to unzip the files and process it .

  • shalindra_2927
    shalindra_2927 Member Posts: 61
    edited Sep 7, 2017 8:27PM

    You are leveraging ITK to do the integration with Ariba.

    We have done this integration successfully. We recommend making use of MFT since MFT comes with encryption/decryption feature also which is important while dealing with sensitive information like PO/Invoices /Remittance etc.

This discussion has been closed.