AnsweredAssumed Answered

Bad credentials presented

Question asked by buurd on Sep 19, 2008
Hi!

I'm getting a error when I added search to a webscript and I can't figure out why. Bad credentials presented. Google have two refereses to this problem but none of the solutions have worked for me. What could be wrong?

A snipplet of the javacode that is affected.

                // get the instances we need for search
      ServiceRegistry serviceRegistery =  this.getServiceRegistry();
      logger.error("ServiceRegistry: " + serviceRegistery);
      SearchService searchService = serviceRegistery.getSearchService();
      logger.error("SearchService: " + searchService);
      // Set up searchParameters
      StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE,
        "SpacesStore");
      logger.error("StoreRef_: " + storeRef);
      SearchParameters searchParameters = new SearchParameters();
      searchParameters.addStore(storeRef);
      searchParameters.setLanguage(SearchService.LANGUAGE_LUCENE);

      
      ResultSet resultSet = null;
      
      // Define the query
      searchParameters.setQuery("TYPE:\"{http://www.alfresco.org/model/content/1.0}content\"");
      
      // Run the query
      try{
         resultSet = searchService.query(searchParameters);
         logger.error("Search found resultSet: " + resultSet);
         for(ResultSetRow row: resultSet){
            NodeRef nodeRef = row.getNodeRef();
            logger.error("Found nodeRef: " + nodeRef.toString());
         }
         
      }finally{
         if(resultSet != null)
            {
                resultSet.close();
            }

      }

The "desc.xml" for the search…

<webscript>
   <shortname>TK Search</shortname>
   <description>Search for dokuments</description>
   <url>/jkptk/search?class={classArgument}&amp;objectId={objectIdArgument}&amp;versionDate={versionDateArgument}&amp;mimetype={mimetypeArgument}</url>
   <format default="xml"/>
</webscript>

Thanks you in advance
Roland

Outcomes