Regarding XML deserialization


I am using the below code to de-serialize my response fetched from server.

StringContent stringContent = new StringContent(result, Encoding.UTF8, "text/xml");

// Sends the request and wait for response
HttpResponseMessage response = await httpClient.PostAsync(uri, stringContent);

// Deserialize response
XmlSerializer serializer = new XmlSerializer(typeof(Responses));
Responses responses = (Responses)serializer.Deserialize(await response.Content.ReadAsStreamAsync());
catch (Exception ex)


The Response format is:
<soap-env:Envelope xmlns:soap-env="">
<n0:_-SIE_-PD_FMROMDResponse xmlns:n0="urn:sap-com:document:sap:rfc:functions">
data comes here

The code in try block shows the error "Envelope xmlns='http //' was not expected." I have even stated XMLRoot attribute ( [XmlRoot(Namespace = "")]) on Response class level.

Could anyone please let me know what could be the issue here.

Thanks in advance.