title: Paging through SharePoint 2010 List via SOAP
body: <p>I'm having trouble paging through a list via SOAP.</p>
  
  <p>I can retrieve a list, but it only ever returns the first 30 items. (which is the setting in the default view).</p>
  
  <pre><code>$methodName = 'GetListItems';
  $listName = '{259134c5-fa87-441e-8c31-641b51193710}';
  $camlQuery="";
  $paging = urlencode('Paged=TRUE&amp;p_ID=30');
  
  $xmlAction = 
      '&lt;GetListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/"&gt;
        &lt;listName&gt;' . $listName . '&lt;/listName&gt;
        &lt;query&gt;' . $camlQuery . '&lt;/query&gt;
        &lt;queryOptions&gt;
              &lt;QueryOptions&gt;
                &lt;Paging ListItemCollectionPositionNext="' . $paging . '" /&gt;
              &lt;/QueryOptions&gt;
            &lt;/queryOptions&gt;
           &lt;/GetListItems&gt;';
  
  echo '&lt;hr&gt;&lt;h1&gt;My Action is:&lt;/h1&gt;&lt;pre&gt;' . htmlentities($xmlAction) . '&lt;/pre&gt;';
  
  $client = new Nusoap_Client($wsdl,true);
  $response = $client-&gt;call($methodName,$xmlAction);
  echo '&lt;hr&gt;&lt;h1&gt;Response:&lt;/h1&gt;&lt;pre&gt;' . htmlentities(print_r($response,true)) . '&lt;/pre&gt;';
  </code></pre>
  
  <p>This returns a response like this, except there are 30 items.</p>
  
  <pre><code>Response:
  
  Array
  (
      [GetListItemsResult] =&gt; Array
          (
              [listitems] =&gt; Array
                  (
                      [data] =&gt; Array
                          (
                              [row] =&gt; Array
                                  (
                                      [0] =&gt; Array
                                          (
                                              [!ows_Region] =&gt; 7
                                              [!ows_District_x0020_ID] =&gt; 1902
                                              [!ows_District] =&gt; SOME ISD
                                              [!ows_Campus_x0020_ID] =&gt; 1902001
                                              [!ows_Campus] =&gt; MY H S
                                              [!ows_Grade_x0020_Range] =&gt; 09-12
                                              [!ows_FileRef] =&gt; 30;#sites/ti/Lists/Schools/30_.000
                                              [!ows_MetaInfo] =&gt; 30;#
                                          )
  
                                  )
  
                              [!ItemCount] =&gt; 30
                              [!ListItemCollectionPositionNext] =&gt; Paged=TRUE&amp;p_ID=30
                          )
  
                  )
  
          )
  
  )
  </code></pre>
  
  <p>The <a href="http://blogs.msdn.com/b/khavas/archive/2008/10/13/sharepoint-getlistitems-and-pagination.aspx" rel="nofollow">documentation says</a> to get the next page, I need to provide the value returned in "ListItemCollectionPositionNext" and query again. That's what the above is doing, and it returns the same 30 records. This list has 26K items in it.</p>
  
  <p>Its not a permission issue. I'm an admin for this list and can manipulate it via the sharepoint web gui.</p>
  
  <p>What else am I missing folks?</p>