title: ResponseXML returned as null or undefined
body: <p>I'm working on a live hotfix and I'm stuck.</p>
  
  <p>A quick explanation of the application architecture: the script sends a XML request to dispatcher.php. At top of dispatcher, content type is set to text/xml. Then a command is set according to the attribute in the request:</p>
  
  <pre><code>&lt;request type="buworkflows"&gt;&lt;unit&gt;10&lt;/unit&gt;&lt;/request&gt;
  </code></pre>
  
  <p>So for the buworkflows command, the db is called and a dataset containing data is returned.</p>
  
  <p>A dropdown is supposed to be dynamically generated using this returned data. However, I'm getting "object required" in IE. The following code worked fine in IE and FF on my dev server, but is failing on live. I can't debug with FF on live; application is tailored for IE and any mods means I affect the live system. So, I have to work with IE now. I've alerted out the unit id and XML request; all is fine. This particular request is only failing for one type of dataset; works fine for the rest.</p>
  
  <p>I hope this is enough information for comment and feedback.</p>
  
  <p>Really need your help guys.</p>
  
  <p>***Final Update: I resolved this issue yesterday guys. Please see explanation in my comment to James. Thanks for your time and help. Resolved.</p>
  
  <p><strong>Update: WS_DISPATCHER resolves to /ws/dispatcher.php. I've confirmed through debugging that it is being passed into the AJAX correctly.</strong></p>
  
  <p>Update: for sakes of completion, the getRequestObject()</p>
  
  <pre><code> function getRequestObject() {
  resetMsgBar();
  var req = null;
  if(XMLHttpRequest) {
      req = new XMLHttpRequest();
      if(req.overrideMimeType)
          req.overrideMimeType("text/xml");
  }
  else if(window.ActiveXObject) {
      try {
          req = new ActiveXObject("msxml2.xmlhttp");
      } catch(e) {
          try {
              req = new ActiveXObject("microsoft.xmlhttp");
          } catch(e) {}
      }
  }
  if(!req)
      return null;
  else
      return req;
  </code></pre>
  
  <p>}</p>
  
  <p>The AJAX code:</p>
  
  <pre><code>                            var req = getRequestObject();
                              var reqXml = new String();
                              reqXml+= "&lt;request type='buworkflows'&gt;";
                              reqXml+= "&lt;unit&gt;" + id + "&lt;/unit&gt;";
                              reqXml+= "&lt;/request&gt;";
                              req.open("POST", "&lt;?=WS_DISPATCHER_ADDR?&gt;", true);
                              req.onreadystatechange = function() {
                                  if(req.readyState==4) {
                                      if(req.status==200) {
                                          //var wfData = new ActiveXObject("microsoft.xmldom");
                                          //wfData.async = false;
                                          //wfData.load(req.responseXml);
                                          var opt = null;
                                          document.getElementById("type").options.length=0;
                                          opt = document.createElement("option");
                                          opt.text ="Please select the assignment type";
                                          opt.value="-1";
                                          document.getElementById("type").options.add(opt);
                                          //if(wfData.documentElement) {    
                                              for(var i=0; i &lt; req.responseXML.documentElement.childNodes.length; i++) {
                                                  opt = document.createElement("option");
                                                  var elem = req.responseXML.documentElement.childNodes[i];
                                                  opt.value = elem.childNodes[0].childNodes[0].nodeValue;
                                                  opt.text = elem.childNodes[2].childNodes[0].nodeValue;
                                                  if (undefined != elem.childNodes[3].childNodes[0]){
                          opt.title = elem.childNodes[3].childNodes[0].nodeValue;
                        }
                        document.getElementById("type").options.add(opt);                                              
                        //}                                                                           
                                                  //opt.text = req.responseXML.documentElement.childNodes[i].firstChild.selectSingleNode("name").text;                                                    
                                                  //opt.value=req.responseXML.documentElement.childNodes[i].selectSingleNode("id").text;
                                                  //opt.title=req.responseXML.documentElement.childNodes[i].selectSingleNode("description").text;
                                                  //document.getElementById("type").options.add(opt);
                                              }
                                          //}
                    loadAdditionalFields(0);
                                          hideProgressBar();
                                      }
                                  }
                              }
              req.send(reqXml);
  </code></pre>