0

Hello everyone I'm very new in C# altho I have some background in Python so I'm not very lost but I have not been able to complete this task.

I'm trying to consume a Webspeed that shows up data from a database, the problem is that I'm to dumb to realize how to make the request using C#, I've been looking for examples but there's no clear examples of how to perform this action.

Also I would like to be clear that the URL I'm trying to consume to get the XML does not shows any XML format, instead I have to click show source on the website, so it can return the actual XML as "view-source:url"

This is an example of the url

"127.0.0.1/cgi-bin/wspd_cgi.sh/WService=ec-dev/app/interfaces/path/sp_sourceofdata.html?num_item=3072464&date_ini=01/01/19&date_end=08/05/19"

And this is the xml I get

<?xml version="1.0" encoding="ISO-8859-1"?><response><datos>
<Documento_abierto>
    <control-ent> </control-ent>
    <machine-id>  </machine-id>
    <trans-code>  or</trans-code>
    <trans-no>    12341567</trans-no>
    <cust-id>     ABC12345</cust-id>
    <trans-id>    ABCD</trans-id>
    <entity-id>   A1234E45</entity-id>
    <ret-id>      </ret-id>
    <mont>       35</mont>
    <serie>       </serie>
    <fis-no>   0</fis-no>
    <trans-date>  07/25/19</trans-date>
    <due-date>    07/25/19</due-date>
</Documento_abierto>
</response>
</data>

Basically this are the instructions I need to perform are:

Query the URL and save the XML data Transform data into JSON Save that JSON data Render JSON data into datatables in ASP.NET website

The big issue I'm facing is the query, I've found examples of all the other instructions.

Can someone point me in the right directions please?

IceeFrog
  • 327
  • 3
  • 16
  • Use httpwebrequest – jdweng Sep 25 '19 at 23:35
  • So far I was able to render the data I require using WebClient, adding the logic in the controller and displaying the html.render in my view, however it shows up without format, I'll try httpwebrequest and post my results, thanks for the tip – IceeFrog Sep 25 '19 at 23:42
  • It won't make a difference. Xml is text and you issue isn't with parsing or getting the xml. You need to do a better job of formating your JSON datatables. – jdweng Sep 26 '19 at 05:12

0 Answers0