2 Replies Latest reply: Sep 10, 2012 3:56 PM by 801120 RSS

    org.openspml.v2.util.Spml2ExceptionWithResponse: Invalid iterator

    801120
      Hi All,

      I am working on SPML communication with Quest SPML provider everything is working fine like create update, delete and lookup, but getting issue in search.
      I want to write a method so that i can get all users in a particular container.

      When i send the search request i got the response back but only 25 users( default values) for rest we have to use Iterator but getting "org.openspml.v2.util.Spml2ExceptionWithResponse: Invalid iterator" error, below the request and response xml.
      Please help to fix the issue and any idea will help.

      This is my SearchRequest::
      <spmlsearch:searchRequest xmlns='urn:oasis:names:tc:SPML:2:0' xmlns:spmlsearch='urn:oasis:names:tc:SPML:2:0:search' executionMode='synchronous' returnData='identifier' maxSelect='50'>
      <spmlsearch:query scope='oneLevel'>
      <dsml:filter xmlns:dsml='urn:oasis:names:tc:DSML:2:0:core'>
      <dsml:or>
      <dsml:equalityMatch name='givenName'>
      <dsml:value>10031</dsml:value>
      </dsml:equalityMatch>
      <dsml:present name='mail'/>
      </dsml:or>
      </dsml:filter>
      <spmlsearch:basePsoID ID='ou=SharePoint Internal,dc=RADEV,dc=LOCAL'/>
      </spmlsearch:query>
      </spmlsearch:searchRequest>

      I am getting the response back and below is the resultsIterator.

      <spmlsearch:resultsIterator xmlns='urn:oasis:names:tc:SPML:2:0' xmlns:spmlsearch='urn:oasis:names:tc:SPML:2:0:search' ID='7'/>

      When i am trying to fecth more values and sending iterateRequest then getting <error>noSuchIdentifier</error> in iterateResponse.

      SpmlClient: sending

      <spmlsearch:iterateRequest xmlns='urn:oasis:names:tc:SPML:2:0' xmlns:spmlsearch='urn:oasis:names:tc:SPML:2:0:search' executionMode='synchronous'>
      <spmlsearch:iterator ID='6'/>
      </spmlsearch:iterateRequest>

      SpmlClient: received
      <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <soap:Body>
      <iterateResponse status="failure" xmlns="urn:oasis:names:tc:SPML:2:0:search">
      <error>noSuchIdentifier</error>
      <errorMessage>Invalid iterator</errorMessage>
      </iterateResponse>
      </soap:Body
      </soap:Envelope>
      Error ========>>>org.openspml.v2.util.Spml2ExceptionWithResponse: Invalid iterator
        • 1. Re: org.openspml.v2.util.Spml2ExceptionWithResponse: Invalid iterator
          user9326077
          Hi,

          did you copy and paste the wrong information? Or why is there a mismatch between the ID you got in the response for your search request and your request for the iterator? Your snippets show an ID of "7" within the response but the request has an ID of "6"

          <spmlsearch:resultsIterator xmlns='urn:oasis:names:tc:SPML:2:0' xmlns:spmlsearch='urn:oasis:names:tc:SPML:2:0:search' ID='7'/>

          <spmlsearch:iterateRequest xmlns='urn:oasis:names:tc:SPML:2:0' xmlns:spmlsearch='urn:oasis:names:tc:SPML:2:0:search' executionMode='synchronous'>
          <spmlsearch:iterator ID='6'/>
          </spmlsearch:iterateRequest>

          Regards
          • 2. Re: org.openspml.v2.util.Spml2ExceptionWithResponse: Invalid iterator
            801120
            OPPs my mistake, to give the example here I mix two Iterator.

            Well my problem got solved, issue was with maintaing the conncetion after fetching th erequest first time and iterator was not working as it lost the connection, so to reolve this we have to maintain the session cookie.

            I used the separate connection of HttpURLConnection and get the cookie value like String sessionCookie = connection.getHeaderField("Set-Cookie");

            and make new connection for iterator everytime and pass the store coookie value like below.

            connection.addRequestProperty("Cookie", sessionCookie);

            :)