Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-22-2008, 07:20 AM
Starter Member
 
Posts: 1
Default PHP Soap -> SearchRequest -> Appointment Problem

Hello,

I have problems to get my appointments with the searchrequest.

The Request is:
Code:
<?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:zimbraMail" xmlns:ns2="urn:zimbra">
<SOAP-ENV:Header>
<ns2:context>
<authToken>
XXXXX</authToken>
</ns2:context>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns1:SearchRequest types="appointment" calExpandInstStar="1193004000000" calExpandInstEnd="1256248799000" />
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
And the Response is
Code:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<context xmlns="urn:zimbra">
<sessionId id="1257174">
1257174</sessionId>
<refresh>
<version>
5.0.10_GA_2638.UBUNTU6 20081003035628 20081003-0401 NETWORK</version>
<mbx s="32736373"/>
<tags>
<tag color="0" name="vxcv" id="64"/>
</tags>
<folder n="0" l="11" name="USER_ROOT" s="0" id="1" rev="1">
<folder view="document" n="0" l="1" name="Briefcase" s="0" id="16" rev="1"/>
<folder view="appointment" f="#" n="6" l="1" name="Calendar" s="23124" id="10" rev="1"/>
<folder view="message" n="107" l="1" name="Chats" s="417871" id="14" rev="1"/>
<folder view="message" f="*" n="174" l="1" name="commits" s="2332654" id="868" rev="1920"/>
<folder view="contact" n="0" l="1" name="Contacts" s="0" id="7" rev="1"/>
<folder view="message" f="*" n="18" l="1" name="Drafts" s="209496" id="6" rev="1"/>
<folder view="contact" n="0" l="1" name="Emailed Contacts" s="0" id="13" rev="1"/>
<folder view="message" n="194" l="1" name="Inbox" s="26284623" id="2" rev="1"/>
<folder view="message" n="0" l="1" name="Junk" s="0" id="4" rev="1"/>
<folder view="wiki" n="0" l="1" name="Notebook" s="0" id="12" rev="1"/>
<folder view="message" f="*" n="53" l="1" name="Sent" s="3466801" id="5" rev="1"/>
<folder view="task" f="#" n="1" l="1" name="Tasks" s="1740" id="15" rev="1"/>
<folder n="0" l="1" name="Trash" s="0" id="3" rev="1"/>
</folder>
</refresh>
<change token="2605"/>
</context>
</soap:Header>
<soap:Body>
<SearchResponse more="0" sortBy="dateDesc" offset="0" xmlns="urn:zimbraMail"/>
</soap:Body>
</soap:Envelope>
I'm sure that there are appointments. But why he doesn't show them?
P.S. The old GetApptSummariesRequest returns the same.

Thank you in advance,

Daniel
Reply With Quote
  #2 (permalink)  
Old 11-03-2008, 02:11 AM
Project Contributor
 
Posts: 14
Default

http://blog.xenco.be/wp-content/uplo...soap-admin.txt
Quote:
-----------------------------
<SearchGalRequest [type="{type}"]>
<name>...</name>
</SearchGalRequest>

<SearchGalResponse more="{more}" [tokenizeKey="{tokenize-key-op}"]>
<cn>...</cn>*
</SearchGalResponse>

{more-flag} = 1 if the results were truncated.

{tokenize-key-op} = and|or
- Not present if the search key was not tokenized.
- Some clients backtrack on GAL results assuming the results of a more
specific key is the subset of a more generic key, and it checks cached
results instead of issuing another SOAP request to the server.
If search key was tokenized and expanded with AND or OR, this cannot
be assumed.

{type} = type of addresses to search
"account" for regular user accounts, aliases and distribution lists
"resource" for calendar resources
"all" for combination of both types
if omitted, defaults to "all"
use zimbra_search_gal(..) with my modification
Code:
function zimbra_search_gal($name,$domain,$type = "all") {
		$xml = new xml2Array();
		$this->set_zimbra_header();
		$soapmessage = $this->soapheader . '
		<SearchGalRequest xmlns="urn:zimbraAdmin" domain="'.$domain.'" type="'.$type.'">
		<name>' . $name . '</name>
		</SearchGalRequest>
		</soap:Body>
		</soap:Envelope>';

		curl_setopt($this->curlhandle, CURLOPT_POSTFIELDS, $soapmessage);
		if (!($zimbraSOAPResponse = curl_exec($this->curlhandle))) {
			$this->zimbraerrno = curl_errno($this->curlhandle);
			$this->zimbraerror = curl_error($this->curlhandle);
			return false;
		}

		$res = $xml->parse($zimbraSOAPResponse);
		if (isset ($res['SOAP:ENVELOPE']['SOAP:BODY']['SEARCHGALRESPONSE']))
			return $res['SOAP:ENVELOPE']['SOAP:BODY']['SEARCHGALRESPONSE'];
		return false;
	}
How does it right reponse for you ?
...
Reply With Quote
  #3 (permalink)  
Old 12-05-2008, 01:46 PM
Starter Member
 
Posts: 1
Default

I am seeing the same behavior. SearchRequest seems to be able to return emails between a specified date just fine, but other types such as tasks and appointments don't seem to have any returned results in SearchResponse. Is this is bug or are we just missing something?
Reply With Quote
  #4 (permalink)  
Old 05-27-2009, 12:32 PM
New Member
 
Posts: 4
Default

From looking at the dev debug mode, it seems that zimbra passes the query "inid:13" which I assume is the calendar id. I think you get it from the refresh or elsewhere.
Reply With Quote
  #5 (permalink)  
Old 09-24-2010, 01:28 PM
be1 be1 is offline
Junior Member
 
Posts: 6
Default

I have the same strange behaviour with zimbra 5.0.11, with a json query:
the body of the reply is empty after a SearchRequest on type "appointment".
Reply With Quote
  #6 (permalink)  
Old 09-24-2010, 02:05 PM
be1 be1 is offline
Junior Member
 
Posts: 6
Default

here is the json query (javascript):

{ "Header": { "context": { "_jsns": "urn:zimbra", "authToken": { "_content": "' + Net.soapAuthToken + '" } }, "format": { "type": "js" } }, "Body":{ "SearchRequest": { "_jsns":"urn:zimbraMail", "sortBy":"dateAsc", "types": "appointment", "fetch": "all", "offset":"' + calOffset + '"; "limit": "30", "calExpandInstStart": "' + Math.floor(StartTime.getTime() / 1000) + '", "calExpandInstEnd": "' + Math.floor(EndTime.getTime() / 1000) + '" } } }

and here is the response:

{"Body":{"SearchResponse":{"more":false,"sortBy":" dateAsc","offset":0,"_jsns":"urn:zimbraMail"}},"He ader":{....etc.... }}
Reply With Quote
  #7 (permalink)  
Old 10-03-2010, 02:46 AM
be1 be1 is offline
Junior Member
 
Posts: 6
Default

OK, to get the appointments, i must provide a calendar folder id in the query:
... "query": { "_content": "inid:10" } } } }
or xml:
...
<query>
inid:10
</query>
</SearchRequest>
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.