Skip to Content
avatar image
Former Member

retrieve data from website

hi all,

I have a requirement to retrieve data from the website http://www.bnm.gov.my/?tpl=exchangerates -- Ringgit Foreign Exchange Conversion.

we need to convert the whole data if possible only selling row data to xml. and do some modifications and send it to ECC system.

Can you please suggest us a way to get the data from website and convert it to xml using SAP PI.

we are using SAP PI 7.4.

please let me know if i am not clear.

Thanks

kavya.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Feb 24, 2015 at 06:29 PM

    Hi Kavya,

    Refer this blog, this exactly fits your requirement.

    Michal's PI tips: Exchange Rates from an XML file on a web page - REST, AXIS

    Regards,

    Pranav

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 25, 2015 at 01:21 AM

    Hi Kavya

    If you so happen to be on the latest SP09 of PI 7.4, then you can consider using the new REST adapter instead of the SOAP Axis adapter.

    New adapter in SAP Process Integration for consumption and provisioning of REST based services

    I checked the BNM site, and the content can be retrieved with just a HTTP GET operation (which is also possible with the HTTP_AAE adapter.)

    However, I've had a look at the response data from the site and the content type returned is HTML. This will be the main challenge as you will need to parse the HTML response to get the exchange rate details from the HTML table, and then convert it to an XML output for further processing.

    You will need to use a Java mapping or custom adapter module to achieve this parsing. I've not done this before, but you can try searching online for some Java library for HTML parser that might help you achieve it.

    Rgds

    Eng Swee

    Add comment
    10|10000 characters needed characters exceeded

    • Kavya

      You won't be able use the sender channel because HTTP_AAE does not support sender polling. Even SAP's own REST adapter does not have the feature yet.


      My suggestion of receiver channel is based on a proxy to HTTP_AAE synchronous approach.

      If you want to design based on sender polling, you can probably check out the SOAP Axis approach that was provided by Ram above. I haven't worked with the SOAP Axis adapter so I won't be able to provide you further input on that.

      Rgds

      Eng Swee

  • Feb 25, 2015 at 07:04 AM

    HI Kavya,

    If the response is a html as Eng pointed out, why don't do a proxy to proxy scenario with a SOAP lookup. You can start the process in your ECC endpoint and at mapping level do a soap lookup (http://scn.sap.com/community/pi-and-soa-middleware/blog/2013/08/07/how-to--soap-lookup), you will need a java development anyway. Your endpoint process will be obviously your same ECC.

    Regards.

    Add comment
    10|10000 characters needed characters exceeded