cancel
Showing results for 
Search instead for 
Did you mean: 

SOAP Axis adapter to pull txt and CSV files

Former Member
0 Kudos

Hello All,

We have a scenario where SAP PO[7.31 SP6, single stack] needs to pull the files[txt and CSV format] from a website.

Can we use SOAP Axis adapter with Task(axis) as the transport protocol to pull the files from the website.

I have searched in scn and no thread talks about txt files but xml files.

Or any other method to achieve this in SAP PI.

Thanks,

Jane

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Check note : 1039369, refer FAQ section for Transport protocol for Axis Adapters.

Cheers,

Sunil

shabbir_mohmad
Participant
0 Kudos

Hi,

I had the same scenario to download files from webpage.

I have followed the script way.

Use Dummy file to file scenario.

On receiver channel, write a script to download file.

Script:

--------

DIR=<your directory to where file should be downloaded >

FILE=taxrate.`date +"%Y%m%d"`

# wget log file

LOGFILE=wget.log

# wget download url

URL=http://xxxxxxxxxxxx.com/daily.txt

cd $DIR

wget $URL -O $FILE -o $LOGFILE

former_member217888
Participant
0 Kudos

Hi,

Can u plz explain in detail about this approach.

If possible with snapshots.

Thanks

Neha

shabbir_mohmad
Participant
0 Kudos

Hi Neha,

All we need is to accommodate a script which we can use to download file from web.

We can provide script details in file receiver adapter (Run Operating System Command after Message Processing) , so  create file to file scenario with Dummy interfaces and dummy interfaces.


receiver determination, interface determination should be with dummy values.


Sender channel: pick some dummy file

receiver channel: give a path where this dummy file can be placed

in receiver channel for the parameter:Run Operating System Command after Message Processing

provide the script path (ex: sh /interf/scripts/script.sh %f)

Now write the below code in a notepad and save as 'script.sh'.

Place the script the specified path (/interf/scripts in my example)

Run the scenario.

Code:

--------

DIR=<your directory to where file should be downloaded (on PI system)

FILE=filename.`date +"%Y%m%d"` (filename with timestamp)

 

# log file.

LOGFILE=wget.log

# wget download url from where you need to download

URL=http://xxxxxxxxxxxx.com/daily.txt

cd $DIR

wget $URL -O $FILE -o $LOGFILE

former_member217888
Participant
0 Kudos

Hi,

Thank u for detailed explanation but we have Windows OS at PI server so I cannot use shell script.

Please let me know its alternate.


Also, my URL is based on HTTPS protocol and is a RESTFUL API.

Does ur approach apply to these URLs as well?

Thanks

Neha

former_member184720
Active Contributor
0 Kudos

Pull the files then apply the message transformation bean to translate the CSV into XML.

Former Member
0 Kudos

Hi Hareesh,

Transformation can be done, but my query is how to pull the txt file from the website.

Can we do that using Soap Axis[Transport Protocol Task(axis)] ?

Thanks,

Jane