Page 5 of 5 FirstFirst ... 345
Results 41 to 47 of 47

Thread: [SOLVED] PHP Class for easy access to Zimbra SOAP API

  1. #41
    meisel is offline Junior Member
    Join Date
    Mar 2011
    Posts
    6
    Rep Power
    4

    Default

    can anyone write the full script??
    it's interesting me to edit password via SOAP

  2. #42
    hoangnam8484 Guest

    Default How modify account in Distribution list

    I need to modify the account in Distribution list vision zimbra 7.x
    in the current script dont have function

    Thanks everyone very much!

  3. #43
    gionn is offline New Member
    Join Date
    Jan 2012
    Posts
    4
    Rep Power
    3

    Cool

    Hi, since the already existing PHP SOAP API libraries was unsatisfactory for us, we have developed and released under GPLv3 a new set of PHP classes.

    I've already opened a new discussion here, please ask there if you need further information: zcs-php - yet another PHP SOAP API library
    Last edited by gionn; 01-23-2012 at 01:46 PM.

  4. #44
    fab
    fab is offline Active Member
    Join Date
    Oct 2008
    Posts
    38
    Rep Power
    6

    Default

    Hello,
    I used to call zmprov with PHP exec() to modify our Zimbra accounts using our identity management web app but I was not satisfied with it (too slow, potentially insecure, Zimbra and apache must be on the same host, apache must be run by the zimbra user), so I started searching for a PHP class that could allow me to modify a Zimbra account via SOAP.
    The most simple and usable class I found was that developed by Yannick Lorenz (no external class or class loader required, simple to use and well documented) but it didn't have a method to modify an account and to get some attributes we use frequently (COS and status among others).
    I have therefore added a bunch of methods to the Zm_Account class, slightly improved Zm_Server and Zm_Domain and rewrote part of the included test.php file accordingly; I finally contacted Yannick and he added me as a member of his project on GoogleCode, so everyone who needs it can download and use the latest version of our zimbra-admin-api-soap-php classes from this URL:
    zimbra-admin-api-soap-php
    Last edited by fab; 05-20-2013 at 04:00 AM.

  5. #45
    fab
    fab is offline Active Member
    Join Date
    Oct 2008
    Posts
    38
    Rep Power
    6

    Default

    It's already complete, we started using it in our production environment some months ago.

  6. #46
    akbar.ali is offline Starter Member
    Join Date
    Sep 2012
    Location
    Pakistan
    Posts
    1
    Rep Power
    2

    Default

    Hi,
    I can not create contact using "CreateContactRequest" I got following soap Fault:
    "unknown document: ns1:CreateContactRequest"
    and Soap Fault Object is
    SoapFault Object
    (
    [message:protected] => unknown document: ns1: CreateContactRequest
    [string:Exception:private] =>
    [code:protected] => 0
    [file:protected] => D :\Program Files and installations\wamp\www\zimbra\Zm\Auth.php
    [line:protected] => 123
    [trace:Exception:private] => Array
    (
    [0] => Array
    (
    [file] => D : \Program Files and installations\wamp\www\zimbra\Zm\Auth.php
    [line] => 123
    [function] => __soapCall
    [class] => SoapClient
    [type] => ->
    [args] => Array
    (
    [0] => CreateContactRequest
    [1] => Array
    (
    [0] => Array
    )

    [2] =>
    [3] => Array
    (
    [0] => SoapHeader Object
    (
    [namespace] => urn:zimbra
    [name] => context
    [data] => SoapVar Object
    (
    [enc_type] => 147
    [enc_value] => 0_3690474a0ce1598b321db5307e4523c60cef25bd_69643d3 3363a66316462303935342d393032372d346165612d6261313 12d3932356332326635373134623b6578703d31333a3133353 03131323635343037383b747970653d363a7a696d6272613b
    )

    [mustUnderstand] =>
    )

    )

    )

    )

    [1] => Array
    (
    [file] => D:\Program Files and installations\wamp\www\zimbra\Zm\Contact.php
    [line] => 301
    [function] => execSoapCall
    [class] => Zm_Auth
    [type] => ->
    [args] => Array
    (
    [0] => CreateContactRequest
    [1] => Array
    (
    [0] => Array
    )

    )

    )

    [2] => Array
    (
    [file] => D:\Program Files and installations\wamp\www\zimbra\test.php
    [line] => 98
    [function] => createContact
    [class] => Zm_Contact
    [type] => ->
    [args] => Array
    (
    )

    )

    )

    [previous:Exception:private] =>
    [faultstring] => unknown document: ns1:CreateContactRequest
    [faultcode] => soap : Sender
    [detail] => stdClass Object
    (
    [Error] => stdClass Object
    (
    [Code] => service.UNKNOWN_DOCUMENT
    [Trace] => btpool0-7://192.168.72.130/service/soap/:1349939854085:998296b1650be397
    )

    )

    My Create Contact function is
    function createContact($attrs = array())
    {
    $result = null;
    $params = array(
    new SoapParam('test@example.com', "email"),
    new SoapParam('first Name', "firstName"),
    new SoapParam('last Name', "lastName"),
    new SoapParam('MM Allam Road', "homeStreet"),
    new SoapParam("Lahore", "homeCity"),
    new SoapParam("Pakistan", "homeCountry"),
    new SoapParam("0300312345", "homePhone"),
    )
    ;
    foreach ($attrs as $key=>$value)
    $params[] = new SoapVar('<a n="' . $key . '">' . $value . '</a>', XSD_ANYXML) ;
    try
    {
    $result = $this->auth->execSoapCall(
    "CreateContactRequest",
    $params
    ) ;
    }
    catch (SoapFault $exception)
    {
    $result = $exception;
    }

    return $result;
    }


    What else i have to do to accomplish my task..?

    Akbar

  7. #47
    sammy66 is offline New Member
    Join Date
    Jul 2014
    Posts
    3
    Rep Power
    1

    Default

    Hi,

    there is lot of bugs in the original zimbraAdmin functions.

    I make another versions without bugs @ this time.

Page 5 of 5 FirstFirst ... 345

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Similar Threads

  1. Replies: 9
    Last Post: 03-01-2008, 08:21 PM
  2. Zimbra shutdowns every n hours.
    By Andrewb in forum Administrators
    Replies: 13
    Last Post: 08-14-2007, 08:55 AM
  3. Can't start Zimbra!
    By zibra in forum Administrators
    Replies: 5
    Last Post: 03-22-2007, 11:34 AM
  4. Replies: 8
    Last Post: 02-27-2007, 04:10 AM
  5. Post instsallation problems
    By Assaf in forum Installation
    Replies: 14
    Last Post: 01-29-2007, 11:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •