locked
Calling Feed Website with XML as a paramter RRS feed

  • Question

  • Hi,

    I have a requirement where my Silverlight App calls the website which provides RSS feed based on the XML string as the Parameter.

    I have a JS code for the same. Can someone help me in constructine the same in SL code. Scott's Digg example passes a value as parameter for the feed. I am looking for the XML as parameter.

    JS Code:

    function loadXMLDoc() {
             req = false;
                // branch for native XMLHttpRequest object
                if(window.XMLHttpRequest && !(window.ActiveXObject)) {
                 try {
               req = new XMLHttpRequest();
                    } catch(e) {
               req = false;
                    }
                // branch for IE/Windows ActiveX version
                } else if(window.ActiveXObject) {
                    try {
                     req = new ActiveXObject("Msxml2.XMLHTTP");
                   } catch(e) {
                     try {
                        req = new ActiveXObject("Microsoft.XMLHTTP");
                     } catch(e) {
                        req = false;
                     }
              }
                }
               
                dom = new ActiveXObject("Microsoft.XMLDOM");
                dom.load("skills.xml");
               
             if(req) {
              req.onreadystatechange = processReqChange;
              req.open("POST", "http://localhost/rss2.0.aspx", false);
              req.send(dom);
             }

    ----------------

    website code for rss2.0 Aspx page:

     protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                XmlDocument xmlSkillsDoc;
                try
                {
                    // Load the XML file from the HTTP input stream - This will throw an XmlException if the XML is malformed.
                    xmlSkillsDoc = new XmlDocument();
                    xmlSkillsDoc.Load(Page.Request.InputStream);
                }

    }

    Aprriciate Help.

    Thanks in Advance.

    Parimal

    Monday, April 7, 2008 3:52 PM

Answers

  • Hello, here's a sample about how to create xml with LINQ to XML. After you construct the xml tree, simply call XElement.ToString on the root element to get a string represent the xml content.

    Thursday, April 10, 2008 4:15 AM