title: SharePoint GetListItems Across Domain
body: <p>I basically need to perform a GetListItems from a SharePoint list on a different server. I have tried different codes but they all error out. Can someone look at what I have and see if it's wrong or if it's just not possible? I get the Error alert then an xData.ResponseText alert as 'undefined'. Nothing after that. The server where I'm running the code is server3.intranet.com. Thank you.</p>
  
  <pre><code>var soapEnv =
      "&lt;soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'&gt; \
          &lt;soapenv:Body&gt; \
               &lt;GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'&gt; \
                  &lt;listName&gt;Shared Documents&lt;/listName&gt; \
                  &lt;viewFields&gt; \
                      &lt;ViewFields&gt; \
                          &lt;FieldRef Name='Title' /&gt; \
                     &lt;/ViewFields&gt; \
                  &lt;/viewFields&gt; \
              &lt;/GetListItems&gt; \
          &lt;/soapenv:Body&gt; \
      &lt;/soapenv:Envelope&gt;";
  
  function Result(xData, status) {
      alert(xData.responseText);
      $(xData.responseXML).find("z\\:row").each(function() {
          var title = $(this).attr("ows_Title");
          alert(title);
      });
  }
  
      $.ajax({
      url: "http://teams02.intranet.com/sites/MySite/_vti_bin/Lists.asmx",
      type: "POST",
      dataType: "JSONP",
      crossDomain: true,
      data: soapEnv,
      complete: Result,
          contentType: "text/xml; charset=\"utf-8\"",
   error:function(){
       alert("Error");
   }
  </code></pre>
  
  <p>So is there anything that needs to be changed in this code? And is the url that I'm using correct? I'm not sure exactly what I should be pointing this at--if it's the list itself or some sort of virtual path.</p>