Search results for query: *

  1. AlexJames

    Resolved Read data from API response

    Thank you so much for your help guys, I've managed to make some progress. I'm going to mark this thread resolved and will start a new one if I face any other problems.
  2. AlexJames

    Resolved Read data from API response

    Hi Skydiver Thank you for your reply and the great suggestions, the "magic strings" will be populated from fields in a database that will be setup in the main application, I just hard coded them in for testing purposes and the same with the error trapping and exceptions, i'll make those more...
  3. AlexJames

    Resolved Read data from API response

    Looks like i'm finally making some progress, managed to deserialze the stream data, next step is to try and read the XML. public class ModitarApiConnection { public class Document { } public Object ModitarWebRequestCall() {...
  4. AlexJames

    Resolved Read data from API response

    Thanks guys, I'm back and hopefully with a clearer head. Just to clarify based on the last two posts, it would be better for me to deserialise the stream and then pass that object back to my calling method, instead of stream to string and then too object.
  5. AlexJames

    Resolved Read data from API response

    No worries at all Sheepings, I really appreciate you guys taking the time to help me with this and learn.
  6. AlexJames

    Resolved Read data from API response

    Thanks Skydiver So with my original plan, once i got the string of data back, i would then need to deserialise that so that i can read the XML. Is my thinking correct with that ?
  7. AlexJames

    Resolved Read data from API response

    Thanks Skydiver, i'm going to step away from this for a bit I'm getting frustrated and making stupid mistakes and missing obvious things. I actually have a ProcessXML class that calls the ModitarWebrequestCall method, I should be doing me deserialization and xml reading in that class, my initial...
  8. AlexJames

    Resolved Read data from API response

    Ah i see now where the OrderedItem comes from, I agree I need to spend more time on serialization etc but i'm on a bit of a time crunch with this one. I also need more experience with XML , this is one section of my development career that i have ignored completely over the years. Ive created...
  9. AlexJames

    Resolved Read data from API response

    Thanks Skydiver I'm just getting bogged down with all the different options and confusing myself even more. Main focus now is just to get this XML data deserialized. In your example i'm assuming that "OrderedItem" is a node in the XML file ?
  10. AlexJames

    Resolved Read data from API response

    I did see something on the web where the dev streamed the data into memory with MemoryStreamer and then deserialised it afterwards, not sure if i'm over complicating this for myself or not.
  11. AlexJames

    Resolved Read data from API response

    Hi Sheepings, I've attached the XML file as it's quite a complex XML file, I haven't worked with anything like it before. " Also note that Deserialize on line 13 expects a xml reader and not a stream reader. " So do i have to re-write the stream reader code and replace it with the XMLreader...
  12. AlexJames

    Resolved Read data from API response

    I'm kind of fumbling around in the dark here, and I'm not sure i'm doing this correctly but i'm getting a "root element missing" error when i hover over the exception. string content = string.Empty; try { using (var response =...
  13. AlexJames

    Resolved Read data from API response

    Hi Sheepings Thank you for your advice, yes that's exactly what I need to do with the XML. i already built the StreamReader that's receiving the data, do i have to replace all that code to use the XmlSerializer ? or can i just deserialise the content that has already come through ?
  14. AlexJames

    Resolved Read data from API response

    Hi Sheepings Sorry about that, the data is coming through as XML. From my limited knowledge on XML it looks quite complex with loads of child nodes. So i'm not quite sure how to process this and also haven't attempted anything like this in C# yet.
  15. AlexJames

    Resolved Read data from API response

    Hi Sheepings I need to save the data to a database.
  16. AlexJames

    Resolved Read data from API response

    Hi All I'm currently consuming a REST api and i need some guidance on reading the response data. My experience with reading this type of data is very minimal and i'm trying to find the best way to do it. below is the code for getting the API data. public string ModitarWebRequestCall()...
  17. AlexJames

    Resolved Consume REST API with credentials

    I basically just replicated what i did in Postman, as per their suggestion. Without the proper API documentation who knows lol, at least it's working.
  18. AlexJames

    Resolved Consume REST API with credentials

    It's unfortunately one of those situations where the client for whatever reason cannot provide a good a spec of the work required, neither any API documentation, trial and error coding LOL.
  19. AlexJames

    Resolved Consume REST API with credentials

    Hi All managed to get it working, the issue was with the encoding, the below works perfectly. request.Headers.Add("username", username); request.Headers.Add("password", password); request.Headers.Add("collection", collection)...
  20. AlexJames

    Resolved Consume REST API with credentials

    Thanks Skydiver, I'll do that. also trying to see if i can grab that data from Postman.
Back
Top Bottom