Hi Team,
I am trying to receive xml response as below but iam not able to bind to xml element because of "&" in recordingurl node.
I have xml resonse as below.
- <?xml version='1.0'?>
- <request>
- <charge>2312</charge>
- <reason>RING</reason>
- <hangup>none</hangup>
- <recording_url>https:
- </request>
My web api code :
- [HttpPost]
- [Route("cdr")]
- [Consumes("application/xml")]
- public async Task<int> CDACallback([xmlelement]request CDaCallbackModel)
- {
- }
added below line in startup.cs
- services.AddMvc().AddXmlSerializerFormatters();
Getting below error message in postman.
{
"errors": {
"": [
"An error occurred while deserializing input data."
]
},
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "|8f5da348-4786fb0f473302ff."
}
Is not possible to bind to XML element ?