I have this certain method(snippet below) for which I want to get the XML result of.
Server
[OperationContract]
[WebGet(UriTemplate = "getcustomerschema/userCode={userCode}/password={password}",
ResponseFormat= WebMessageFormat.Xml,
RequestFormat= WebMessageFormat.Xml,
BodyStyle= WebMessageBodyStyle.Wrapped)]
public DataSet GetCustomerSchema(string userCode, string password)
{
//method
}
Client
using (HttpResponseMessage response = m_RestHttpClient.Get("getcustomerschema/userCode=admin/password=admin"))
{
//how can I get the xml resuly from the httpResponseMessage?
}
Thanks
DataSet dst = new DataSet();
dst.ReadXml(response.Content.ReadAsStream(), XmlReadMode.ReadSchema);
This is how I convert a HttpResponse to a data set then if I need the XML i just extract this from the data set
Hopefully this helps other REST developers