cancel
Showing results for 
Search instead for 
Did you mean: 

HTTPS to File Scenario in PI 7.4

Former Member
0 Kudos

Hello Everyone,

I have a requirement where PI needs to connect to a bank server using HTTPS and fetch some encrypted file and save the file on a file system.

I am confused on whether to use HTTP adapter or HTTP_AAE adapter.

Below are the steps of the scenario.

1. PI pings a predefined URL provided by the bank using HTTPS . This URL points to a folder in the banks file system.

2. The bank will send a response with a list of filenames present in the folder.

3. PI filters the filenames and fetches the correct filename and then again creates a new URL to access the encrypted file.

4. Once PI has access to the file it should put the file from bank folder to a file system using a file adapter.

Please let me know how can i achieve this.

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

engswee
Active Contributor
0 Kudos

Hi Husain

First of all, can you provide details of your system, is it single stack or dual stack? Does it have the REST adapter? Is it a PO system (with NW BPM) or not?

Sender HTTP (or HTTP_AAE) only works in listener mode and therefore cannot trigger a third party URL, it only listens to incoming message. For your case, it looks like the triggering of the URL needs to come from your end.

Your interface needs a stateful mechanism as it involves two separate (but related) calls to the Bank's system. This stateful mechanism can be achieved by either a BPM or an ABAP calling program (via synchronous ABAP proxy) on a backend system.

Also, can you clarify what is the logic to filter and determine the correct file to fetch? And what type of encryption is involved and do you also need to perform decryption?

Once you provide details above, especially the capabilities of your system, then only it is possible to design an appropriate solution.

Regards

Eng Swee

Former Member
0 Kudos

Hi Eng Swee,

It is a dual stack system . No we do not have REST adapter and  no NW BPM.

During the first call to the bank we will receive a XML response which will contain the URL for all the files present in the target system.

All the old files will have an extension '.downloaded'. So we need to parse the XML to see if there is any URL which does not end with an extension '.downloaded'.

Once we find the URL we will call the same and download the file in our file system.

We are not responsible for decrypting the file.We just need to pick and drop the file from bank system to our file system.

Thanks

Husain

engswee
Active Contributor
0 Kudos

Hi Husain

Since you do not have the REST adapter, you cannot do sender channel polling for the first call. As such, the first call needs to be via a receiver adapter.

You can go for a two interface design sequence by an ABAP program.

1) ABAP proxy > PI > HTTP_AAE

Synchronous call triggered by ABAP program via proxy to retrieve the list of files in system. ABAP program will filter those that haven't been downloaded and call the second interface asynchronously.

2) ABAP proxy > PI > HTTP_AAE > PI > File/FTP

Async-Sync bridge to retrieve the file and route it to a file system. URL for second call constructed dynamically by ABAP program and passed through proxy, and stored into dynamic configuration

Regards

Eng Swee

Former Member
0 Kudos

Thanks Eng Swee,

I was thinking to use BPM for achieving this.

1. ABAP Proxy> BPM > HTTP_AAE >File

The ABAP proxy would trigger the BPM which would call the receiver HTTP adapter in the first call fetch the files. In the BPM I could call a RFC to SAP to filter the file names and return the file to be read.

The BPM will continue and then fetch the correct file using the HTTP adapter and finally the FTP.

I am not sure will this work or no.

engswee
Active Contributor
0 Kudos

Hi Husain

Yes, it is possible to go with a ccBPM design too. I would have suggested that as an option if you have the REST adapter which supports sender polling. This would allow you to skip the ABAP proxy for triggering and have a full PI-based solution.

However, I suggested the ABAP based approach because:-

i) You need an ABAP program to trigger the interface since there is no REST adapter to poll

ii) Since you already need an ABAP calling program because of i), it'd be better to have the logic to filter the names there (from the sync response of the first call) instead of creating another RFC for it. This way, you just have one ABAP development object

iii) If it is possible to have more than 1 files that have not been downloaded, it will be easier to filter and make subsequent calls from ABAP rather than from PI/ccBPM.

iv) As you might know, ccBPM can be performance intensive and need to designed efficiently. This is not to mean ccBPM is to be avoided at all, but needs to be weighed accordingly on a case-to-case basis. Since this design can be achieved with ABAP, I would personally go for the ABAP-based approach.

Regards

Eng Swee

Former Member
0 Kudos

HI Eng Swee,

I could see the REST adapter available in our PI system.Probably I missed it

Can you tell me now how can this scenario be implemented?

Thanks

Husain

Former Member
0 Kudos

From all the discussions above and with REST using ccBPM the scenario should look like -


HTTP -> PI -> FILE


The HTTP and File Interface call should both be synchronous, with transformation, correlation and receiver in the ccBPM Integration Process.

This I feel will be an efficient design.

engswee
Active Contributor
0 Kudos

Hi Husain

Can you confirm the following first?

i) Does your REST adapter have the polling feature as described in the following? Your system needs to be at least 7.31 SP16 or 7.4 SP 11.

ii) Confirm my previous comment - is there any possibility to have more than 1 files that needs be downloaded?

Regards

Eng Swee

Former Member
0 Kudos

Hi Eng Swee,

1. Yes my PI system has the REST Polling functionality. We are on PI 7.4 SPS11.

2. At a time only 1 file needs to be downloaded.

engswee
Active Contributor
0 Kudos

Hi Husain

With these two last pieces, the jigsaw puzzle is now complete!

It is possible to achieve your requirement using an async-sync bridge with modules, without any additional ABAP or ccBPM developments.

It will be two scenarios linked by a bridge as follows:-

Sender REST Polling (async) --> PI --> Receiver REST (sync bridge) --> PI --> Receiver File/FTP

It should be easy to implement logic to filter the list of files returned by the polling REST adapter using a Message Mapping, this way you don't require an RFC call to an ABAP FM to perform the logic.

There are various materials on SCN that you can search for regarding bridges, the following IMHO is one of the most straightforward and concise.

Do check the comment by regarding the patch level required for the bridge to work for REST adapter.

Regards

Eng Swee

Former Member
0 Kudos

Thanks Eng Swee

I now have some fair idea on the approach to take and will explore on this.

Will keep updating if I face any roadblocks.

Thanks again.

Former Member
0 Kudos

Can we setup the REST receiver adapter to have dynamic URL endpoint ?

As the actual file name to be picked will be determined at runtime from the initial response of the bank.

former_member186851
Active Contributor
0 Kudos

Hello Husain,

Rest Adapter supports Dyanmic URL.

Below link will have all details about Rest Adapter.

engswee
Active Contributor
0 Kudos

Hi Husain

Dynamic URL endpoint is a very common requirement and yes, it is supported by the REST receiver adapter. You can check out an example in the article below.

From a design perspective, I believe that your queries should have been more or less addressed. As such, I'd suggest that you close the thread as mentioned below:-

When you actually get stuck during development/implementation, you can then open a new thread in the forum with the specifics of your issue.

Regards

Eng Swee

adalid
Participant
0 Kudos

Hello Husain,

I think you should use the HTTP_AAE Adapter, it's available since 7.3 version, I suggest you to create an HTTP to File Synchronous Scenario.


HTTP <---------------------------- SAP PI

HTTP --(Bank Response)--> SAP PI --(FETCHING FILENAME)--> FILE


Chek below links:

HTTP_AAE Document:
http://scn.sap.com/docs/DOC-44764

Example:

http://scn.sap.com/community/pi-and-soa-middleware/blog/2012/03/22/e-payment-a-customized-solution-o...

Saludos Cordiales !! Adalid.

Former Member
0 Kudos

Thanks Adalid.

So will it be Sender HTTP or Receiver HTTP Adapter? Because in case of Sender the bank will trigger our PI server correct?

My problem is the initial URL which the bank has provided will only point to a folder and the first response will provide me the actual URL of the bank acknowledgement file. So i am confused whether there will be 2 HTTP channels to be created for this as the URL would be determined dynamically.

Would appreciate if you can provide your inputs.

adalid
Participant
0 Kudos

Hello Husain,

If you are going to receive information from the Bank through a HTTP request, you have to create a Sender HTTP Adapter, for the information you're giving I think you need only one channel, perhaps through functions mapping you can determine the URL, I recommend you to research about Synchronous Scenarios to know what is your best option.

Check this out:

HTTP To RFC Synchronous Scenario - FAQs - Process Integration - SCN Wiki

Saludos Cordiales !! Adalid.