2 Replies Latest reply on Sep 10, 2012 8:56 PM by 801120

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

      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:equalityMatch name='givenName'>
      <dsml:present name='mail'/>
      <spmlsearch:basePsoID ID='ou=SharePoint Internal,dc=RADEV,dc=LOCAL'/>

      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'/>

      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">
      <iterateResponse status="failure" xmlns="urn:oasis:names:tc:SPML:2:0:search">
      <errorMessage>Invalid iterator</errorMessage>
      Error ========>>>org.openspml.v2.util.Spml2ExceptionWithResponse: Invalid iterator
        • 1. Re: org.openspml.v2.util.Spml2ExceptionWithResponse: Invalid iterator

          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'/>

          • 2. Re: org.openspml.v2.util.Spml2ExceptionWithResponse: Invalid iterator
            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);