Search code examples
biztalkbiztalk-2010

Can BizTalk be used to fetch data from a dynamic URL?


I see that BizTalk has support for consuming web services Tutorial 5: Invoking a REST Interface Using BizTalk Server (learn.microsoft.com)

There is a website like https://thesite.com/12345/20200815/data.csv . The part that is 20200815 changes every day. Can BizTalk download data from such a source using the web service consumption feature with the date part changed every day?


Solution

  • Below is the solution I would do and have done in BizTalk 2013 R2 up. However it might be slightly different with the Open Source Web Rest adapter for BizTalk 2010

    1. Have SQL polling receive location that runs a stored procedure that returns the date. An alternative is a schedule adapter and a map that sets the date.
    2. Promote that date field in the SQL polling schema
    3. Have a WCF-WebHttp send port where you have the date in the HTTP Method and URL mapping
    4. Use the Variable Mapping to set that Date variable

    HTTP Method and URL mapping

    <BtsHttpUrlMapping>  
       <Operation Method="GET" Url="/12345/{Date}/data.csv" />  
    </BtsHttpUrlMapping>
    

    Variable Mappping

    enter image description here