Reading XML from API in C#



I am trying to read from an API which returns me XML. I would like to pull this xml and save it into sql server.


I am trying to do this in C#. I have tried many times but no luck. Couldnt find a way. Could you please advise or guide me about where i should start?


My question is: how can i send request (let say every hour) to this api and pull xml and save the result into my database in C#?


This is api address:


http://ift.tt/1zkaWsm


This is XML POST Request:



<TransactionSearchRequest xmlns="http://ift.tt/1zkaUAH">
<ID>1234567891</ID>
<Date>03.12.2014</Date>
</TransactionSearchRequest>


This is XML response:



<TransactionSearchResponse
xmlns:i="http://ift.tt/ra1lAU" xmlns="http://ift.tt/1zkaUAH">
<Transactions>
<Transaction>
<AcctNo i:nil="true" />
<Amount>99</Amount>
<ID>1234567891</ID>
<Description>TEST</Description>
<ResultMessage i:nil="true" />
</Transaction>
</Transactions>
<SearchResultCode>1</SearchResultCode>
<SearchResultMessage>Search succesfull</SearchResultMessage>

No comments:

Post a Comment