Click here to Skip to main content
15,881,139 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
"here url xml"


**And it's my controller**
[HttpGet]
public JsonResult getXMLrequest()
{

var response = new HttpResponseMessage();
var urlDJP = Request.QueryString["urldjp"];
var data = new VatInRecieveModels();
using (HttpClient client = new HttpClient())
{
client.BaseAddress = new Uri(getBaseUri());
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/xml"));
var uri = string.Format(urlDJP);
response = client.GetAsync(uri).Result;
data = response.Content.ReadAsAsync<list><mymodel>>().Result.SingleOrDefault();
}

var jsonObj = new
{
success = true,
data = data
};
return Json(jsonObj, JsonRequestBehavior.AllowGet);
}

note : urdjp it's parameter from front / gui. and the value

**so, and it's my model**
public class mymodel{
public String day{ get;set; }
public String date{ get;set; }
public String low{ get;set; }
public String high{ get;set; }
public String text{ get;set; }
public String code{ get;set; }
}

**question**
How to submit xml value from url to list my model?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900