Difference between revisions of "Open-Xchange Provisioning using SOAP"

(Provision Open-Xchange using SOAP)
Line 5: Line 5:
 
'''PHP users, please read the PHP warning below!'''
 
'''PHP users, please read the PHP warning below!'''
  
The setup instructions for the SOAP services can be found in [http://software.open-xchange.com/OX6/doc/SOAP/admin/OX-Admin-SOAP.html this document].
+
== Setup SOAP services on Open-Xchange ==
 +
 
 +
{{InstallPlugin|pluginname=open-xchange-admin-soap|sopath=products/appsuite/stable/backend|version=6.22 or newer}}
 +
 
 +
The setup instructions for the 6.20 SOAP services as well as still valid API documentation can be found in [http://software.open-xchange.com/OX6/doc/SOAP/admin/OX-Admin-SOAP.html this document].
  
 
== Example code ==
 
== Example code ==

Revision as of 11:14, 27 August 2013

Provision Open-Xchange using SOAP

Beneath RMI and commandline, Open-Xchange can be provisioned using SOAP.

PHP users, please read the PHP warning below!

Setup SOAP services on Open-Xchange

Install on OX 6.22 or newer

Debian GNU/Linux 10.0

Add the following entry to /etc/apt/sources.list.d/open-xchange.list if not already present:

deb https://software.open-xchange.com/products/products/appsuite/stable/backend/DebianBuster/ /
# if you have a valid maintenance subscription, please uncomment the 
# following and add the ldb account data to the url so that the most recent
# packages get installed
# deb https://[CUSTOMERID:PASSWORD]@software.open-xchange.com/products/products/appsuite/stable/backend/updates/DebianBuster/ /

and run

$ apt-get update
$ apt-get install open-xchange-admin-soap

Debian GNU/Linux 11.0

Add the following entry to /etc/apt/sources.list.d/open-xchange.list if not already present:

deb https://software.open-xchange.com/products/products/appsuite/stable/backend/DebianBullseye/ /
# if you have a valid maintenance subscription, please uncomment the 
# following and add the ldb account data to the url so that the most recent
# packages get installed
# deb https://[CUSTOMERID:PASSWORD]@software.open-xchange.com/products/products/appsuite/stable/backend/updates/DebianBullseye/ /

and run

$ apt-get update
$ apt-get install open-xchange-admin-soap


The setup instructions for the 6.20 SOAP services as well as still valid API documentation can be found in this document.

Example code

You can find Perl and PHP example code in the cvs within the repository open-xchange-admin-soap. Checkout using the command

$ cvs -d :pserver:anonymous@www.open-xchange.com:/cvsroot co open-xchange-admin-soap

once checked out, find examples in

open-xchange-admin-soap/test/perl
open-xchange-admin-soap/test/php

Further documentation and examples:

Short warning to PHP users

We do not recommend to use PHP when accessing our SOAP provisioning API. This is because PHP has trouble sending simple arrays in a way we can handle it. This applies to ALL Open-Xchange versions!

If you still want to use PHP, you might need this information:

instead of

      #$ctx = new Context();
      #$ctx->id = $random_id;
      #$ctx->maxQuota = 10;
      #$ctx->loginMappings = array( "mapping1", "mapping2", "mapping3");

in php you have to do

      $mctx = array("id" => $random_id, "maxQuota" => 10);
      $mctx["loginMappings"] = "mapping1";
      $mctx["loginMappings "] = "mapping2";
      $mctx["loginMappings  "] = "mapping3";

and then this:

      $result = getContextClient($SOAPHOST)->create(new SoapVar($mctx,SOAP_ENC_OBJECT), $user, getCredentialsObject($OXMASTER_ADMIN, $OXMASTER_ADMIN_PASS));

instead of that:

      #$result = getContextClient($SOAPHOST)->create($ctx, $user, getCredentialsObject($OXMASTER_ADMIN, $OXMASTER_ADMIN_PASS));

when using the examples from

open-xchange-admin-soap/test/php

This information is based on this code

 printo_stderr("Update context aliases list\n");

 // XXX: OX requires all mappings entries on top level of context
 // PHP SOAP serializer can't accomplish such task
 // workaround problem naming keys in array with spaces:
 // - transparent for XML, different for PHP
 $map = array('id' => $ctx->id);
 $key = 'loginMappings';
 for ($i = 0; $i < count($mappings); $i++) {
        $map[$key] = $mappings[$i];
        $key .= ' ';
 }

as taken from the Parallels APS package (see above).