Im fairly new to XML coding and need some help with a LINQ query that will allow me to return the String the represents the Site Address in the XML response shown in the image below:
The XML is the response to an REST GET query for our cloud based job costing system. The code I have so far is shown below:
string endpoint = "https://api.workflowmax.com/job.api/get/"+ jobnum + "/customfield?apiKey=" + API_Key + "&accountKey=" + Account_Key; var client = new RestClient(endpoint: endpoint, method: HttpVerb.GET); var json = client.MakeRequest(); string response = json; //load the unparsed string into an XML document XDocument xdoc = new XDocument(); xdoc = XDocument.Parse(response); string deliveryaddress = xdoc.Descendants("CustomFields").Single().Value; How can i get just the text that represents the delivery address?
No comments:
Post a Comment