[WebMethod]
public string VerifyXmlRequest(string XML)
{
XmlDocument request = new XmlDocument();
request.LoadXml(XML);
XmlNode someTestNode = request.SelectSingleNode("//XmlRequestRoot/SomeNode/RequestType");
if(someTestNode != null && someTestNode.InnerText == "CorrectLayout")
{
return true;
}
// in any other case request isn't valid so return invalid message
return false;
}
now you'd use it like this:
SomeServiceName serviceAPI = new SomeServiceName();
if(serviceAPI.VerifyXmlRequest(xmlstring))
{
Response.Write("Request accepted!");
}
else
{
Response.Write("Invalid request!");
}
if this what you wanted to do?
Best of luck.