adsense

Thursday, November 16, 2017

Removing XML Nodes from a XML Document

Following code can be used to remove a XmlNode with all the children nodes

      XmlDocument doc = new XmlDocument();
        doc .Load(MapPath("~/FileName.xml"));
        XmlNodeList selectedNodes = doc .SelectNodes("//SubNode");
      
       foreach (XmlNode node in selectedNodes )
        {
            node.ParentNode.RemoveChild(node);
        }

Regards,
Samitha

Thursday, November 2, 2017

IIS error accessing WCF (HTTP Error 404.3)

When accessing a WCF service through browser, you  might have encountered following IIS error.

HTTP Error 404.3 - Not Found The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

This occurs due to a feature in IIS which is not turned on by default.


This issue can be solved through following steps.

  1. From Control Panel -> Programs and Features -? Turn Windows features on or off.
  2. Click.NET Framework 4.6 Advanced Services - WCF Services (actual framework version may change)
  3.  Select HTTP Activation
  4. Ok