Attempt failing.

View: New views
3 Messages — Rating Filter:   Alert me  

Attempt failing.

by Dirk Bartley :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Greetings

Looking for an example of how to format a query in php.


<?php
#include "zogi+memcache.php";
require_once("zogi.php");
$hostname = "mta1";
$username = "dbartley";
$password = "xx";
$ogo = new OpenGroupwareServer($hostname, $username, $password);
print $ogo->getLoginAccountId();


#query = [ { 'conjunction' : 'AND', 'key' : 'name', 'value' : last,
'expression' : 'EQUALS' } ]

$entityName = 'Contact';
$criteria = array();
$criteria['key'] = 'name';
$criteria['value'] = 'Conrad';
$criteria['expression'] = 'EQUALS';
#print_r($criteria);
$flags = array();
$detail = 0;
$result = $ogo->searchForObjects($entityName, $criteria, $detail = 1,
$flags);
print_r($result);

?>

yeilds the following results.  I imagine I'm just composing the criteria
incorrectly.

10220Array ( [faultCode] => 0 [faultString] => ObjcRuntimeException:
NSConcreteSmallDictionary (instance) does not recognize objectAtIndex:
{ methodName = "zogi.searchForObjects"; methodParameters = ( Contact,
{ expression = EQUALS; key = name; value = Conrad; }, 1, {} ); } )

Dirk

--
OpenGroupware.org XML-RPC
xmlrpc@...
http://mail.opengroupware.org/mailman/listinfo/xmlrpc

Re: Attempt failing.

by Adam Tauno Williams :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


This is the same  instance where Consonance is working?

> Looking for an example of how to format a query in php.
> <?php
> #include "zogi+memcache.php";
> require_once("zogi.php");
> $hostname = "mta1";
> $username = "dbartley";
> $password = "xx";
> $ogo = new OpenGroupwareServer($hostname, $username, $password);
> print $ogo->getLoginAccountId();
> #query = [ { 'conjunction' : 'AND', 'key' : 'name', 'value' : last,
> 'expression' : 'EQUALS' } ]
> $entityName = 'Contact';
> $criteria = array();
> $criteria['key'] = 'name';
> $criteria['value'] = 'Conrad';
> $criteria['expression'] = 'EQUALS';
> #print_r($criteria);
> $flags = array();
> $detail = 0;
> $result = $ogo->searchForObjects($entityName, $criteria, $detail = 1,
> $flags);
> print_r($result);
> ?>
> yeilds the following results.  I imagine I'm just composing the criteria
> incorrectly.
> 10220Array ( [faultCode] => 0 [faultString] => ObjcRuntimeException:
> NSConcreteSmallDictionary (instance) does not recognize objectAtIndex:
> { methodName = "zogi.searchForObjects"; methodParameters = ( Contact,
> { expression = EQUALS; key = name; value = Conrad; }, 1, {} ); } )

Try -
searchForObjects($entityName, array($criteria), $detail = 1, $flags);

I believe criteria has to be an array of criteria.

--
OpenGroupware.org XML-RPC
xmlrpc@...
http://mail.opengroupware.org/mailman/listinfo/xmlrpc

Re: Attempt failing.

by Dirk Bartley :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yup, that did it.

Dirk

-----Original Message-----
From: Adam Tauno Williams <awilliam@...>
Reply-to: xmlrpc@...
To: xmlrpc@...
Subject: Re: [OGo-XML-RPC] Attempt failing.
Date: Fri, 04 Sep 2009 15:57:33 -0400

This is the same  instance where Consonance is working?

> Looking for an example of how to format a query in php.
> <?php
> #include "zogi+memcache.php";
> require_once("zogi.php");
> $hostname = "mta1";
> $username = "dbartley";
> $password = "xx";
> $ogo = new OpenGroupwareServer($hostname, $username, $password);
> print $ogo->getLoginAccountId();
> #query = [ { 'conjunction' : 'AND', 'key' : 'name', 'value' : last,
> 'expression' : 'EQUALS' } ]
> $entityName = 'Contact';
> $criteria = array();
> $criteria['key'] = 'name';
> $criteria['value'] = 'Conrad';
> $criteria['expression'] = 'EQUALS';
> #print_r($criteria);
> $flags = array();
> $detail = 0;
> $result = $ogo->searchForObjects($entityName, $criteria, $detail = 1,
> $flags);
> print_r($result);
> ?>
> yeilds the following results.  I imagine I'm just composing the criteria
> incorrectly.
> 10220Array ( [faultCode] => 0 [faultString] => ObjcRuntimeException:
> NSConcreteSmallDictionary (instance) does not recognize objectAtIndex:
> { methodName = "zogi.searchForObjects"; methodParameters = ( Contact,
> { expression = EQUALS; key = name; value = Conrad; }, 1, {} ); } )

Try -
searchForObjects($entityName, array($criteria), $detail = 1, $flags);

I believe criteria has to be an array of criteria.


--
OpenGroupware.org XML-RPC
xmlrpc@...
http://mail.opengroupware.org/mailman/listinfo/xmlrpc