Posts

Showing posts from August, 2017

Receive invalid xml through WCF adapter

Image
Recently I had a small project that involved getting exchange rate data from the website of the Central Bank of the Republic of Turkey (CBRT). http://www.tcmb.gov.tr/kurlar/201707/10072017.xml Basically I just needed to do an HTTP GET to a specific URL, and that would give me back an xml with the exchange rate information I needed. So my first thought was to just use a WCF sendport with the webHttpBinding to download this. The first test I make results in the following error message. System.Xml.XmlException: Processing instructions (other than the XML declaration) and DTDs are not supported. Line 2, position 2. When I looked closer at the XML I get back, I saw that it contained a reference to an xsl file to make the file readable through a browser. <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="isokur.xsl"?> <Tarih_Date Tarih="07.07.2017" Date="07/07/2017"  Bulten...