CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • soap authentication on multiserver
Pages: [1]

Author Topic: soap authentication on multiserver  (Read 2090 times)

ema

  • Guest
soap authentication on multiserver
October 16, 2007, 11:19:15 am
The organization I am working at is using CiviCRM as a contacts and mailing management system.

So far everything is working out great for the most part but I have have some problem with soap interface for opt-out, unsubscribe and bounces.

We have 3 load balanced apache (v. 2) server, one mysql (v. 5) with replication and php (v. 5)

We use gmail for your domain as mail server and so we can't use neither amvis or imap2soap. We found a solution with libgmailer and we're able to scan mailbex we setup for optout and bounces. At this point we need to connect to civicrm using soap interface and we had a problem with soap authentication; the script is able to connect and receive the key

Code: [Select]
<?
$client =& new SoapClient(null, array(
           'location' => 'http://localhost/drupal/modules/civicrm/extern/soap.php',
           'uri' => 'http://localhost')
        );

$key = $client->authenticate( DRUPAL_USER_NAME, DRUPAL_USER_PASSWORD );
$params = array('contact_id' => 101);
$returnProperties = null;
$result =& $client->get_contact( $key, $params, $returnProperties );

print_r($result);
?>

But next time we connect we get an invalid key:
Code: [Select]
PHP Warning:  Module 'mysql' already loaded in Unknown on line 0
PHP 5.0.4 (cli) (built: Nov 30 2005 14:47:00)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.4-dev, Copyright (c) 1998-2004 Zend Technologies
[root@ewhserver357 libgmailer]# php soap.php
PHP Warning:  Module 'mysql' already loaded in Unknown on line 0
PHP Fatal error:  Uncaught SoapFault exception: [SOAP-ENV:Client] Invalid key: KEY=61329344c3531d8f0457e40eb11c53b4f324a868 SOAP= in /root/libgmailer/soap.php:19
Stack trace:
#0 /root/libgmailer/soap.php(19): SoapClient->__call('get_contact', Array)
#1 /root/libgmailer/soap.php(19): SoapClient->get_contact('61329344c3531d8...', Array, NULL)
#2 {main}
  thrown in /root/libgmailer/soap.php on line 19

We add some debug to SoapServer.php and we noticed that the problem is in the session.
Code: [Select]
KEY=61329344c3531d8f0457e40eb11c53b4f324a868 SOAP=
Each time we connect we have different server and so different session. I guess this problem is solved on the web part because drupal is taking care of it, but not with soap.

I guess the only way to solve this for us is to create a drupal module, scan the gmail box and use the functions directly.

Any suggestion?


ema


Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • soap authentication on multiserver

This forum was archived on 2017-11-26.