You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by Ralph Scheuer <ra...@gmx.net> on 2004/10/15 19:09:22 UTC

Help, please: Exchange SearchMethod problem

Hello,

I am currently starting out with the Slide Client and I tried to query 
an Exchange 2000 Server. While my propfind code works well, I did not 
manage to master the SearchMethod that I have to used for SQL-based 
queries.

In the list archives, I found some code similar to my snippet below.

However, when I execute this SearchMethod, I get the following error 
message via System.out:

[Fatal Error] strict.dtd:81:5: The declaration for the entity 
"ContentType" must end with '>'.

Can anybody tell me how to avoid this error or take a peek at my code 
what I am doing wrong?

Thanks for helping.

Ralph Scheuer

PS: In the Exchange URL, please don't bother with the "Posteingang" 
folder, this is just the name of the inbox folder in the German 
Exchange version. This is perfectly okay and the folder is visible via 
Exchange Explorer.



		HttpClient client = new HttpClient();
		
		try{
		    client.startSession("some-exchangeserver.de", 80, new 
UsernamePasswordCredentials("myusername", "mypassword"));
		    StringBuffer qu = new StringBuffer();
		    qu.append("<?xml version =\"1.0\"?>");
		    qu.append("<d:searchrequest xmlns:d=\"DAV:\">");
		    qu.append("<d:sql>");
		    qu.append("SELECT  \"DAV:id\", ");
		    qu.append("        \"urn:schemas:httpmail:subject\",  ");
		    qu.append("        \"urn:schemas:httpmail:from\",  ");
		    qu.append("        \"urn:schemas:httpmail:displayto\",  ");
		    qu.append("        \"urn:schemas:httpmail:textdescription\"  ");
		    qu.append("FROM SCOPE('shallow traversal of ");
		    qu.append("\"" + 
"http://some-exchangeserver.de/exchange/username/Posteingang" + 
"\"')");
		    qu.append("</d:sql>");
		    qu.append("</searchrequest>");
		
		    System.out.println(qu.toString());
		
		    SearchMethod sm = new SearchMethod("/exchange/e110904313/", 
qu.toString());
		
		    client.executeMethod(sm);
		    Enumeration enum = sm.getAllResponseURLs();
		    while(enum.hasMoreElements()){
			NSLog.out.appendln(enum.nextElement());
		    }

[continued...]


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: Help, please: Exchange SearchMethod problem

Posted by Ralph Scheuer <ra...@gmx.net>.
Hello again,

Am 15.10.2004 um 19:09 schrieb Ralph Scheuer:

> [cry for help]
>
> 		    qu.append("</searchrequest>");

Sorry for that, it was my fault in the code... should have been
qu.append("</d:searchrequest>")

The strange error message distracted me from the actual glitch.

Nothing to see here, just a crying newbie ;-)

Ralph Scheuer


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org