Hi,

I'm getting the following error when trying to post to a list:

*There was an error subscribing to the list: NuSOAP library error*

I've got nusoap installed at the following path *sites/all/modules/contrib/mailbuild*

This is showing the nusoap.php (nusoap/lib/nusoap.php) as installed. I've added the correct API key and list key.

Any suggestions?

Zap

CommentFileSizeAuthor
#3 mailbuild-debug.patch767 bytesbenkant

Comments

dragonwize’s picture

That message likely means that the soap call failed. Do you have any restrictions on your machine?

I am doing D6 development only so don't have the time to debug on D5. If you or someone else fixes a bug in D5, I would be happy to commit it.

Firetracker’s picture

Hi,

Thanks for getting back to me so quickly.

Yes the problem does appear to be in the mailbuild_soap_call function but I'm stumped.

I'm running PHP 5.2.5 locally and 5.2.2 on my production server and the same issue is occurring. I don't believe there are any restrictions set. Is there anything specific I should be looking for?

Cheers
Zap

benkant’s picture

StatusFileSize
new767 bytes

Hi Zap,

Would it be possible for you to apply the attached patch? This should give you (us) a better indication of the problem.

This article will tell you how the apply the patch: http://drupal.org/patch/apply

Once the module is patched, try adding an address to the list. It will give a more detailed error, which you can post here.

Thanks,
Ben

Firetracker’s picture

Hi,

Thanks. I've applied the patch. The code returns an empty result.

$result['faultstring'];

returns nothing. I think the problem is in:

function mailbuild_soap_call($operation, $params) {
  if (@include_once(realpath(mailbuild_nusoap_path()))) {
    $wsdl = variable_get('mailbuild_service_url', '');
    $client = new nusoap_client($wsdl, TRUE);
    $result = $client->call($operation, $params);
    return $result;
  }
  else {
    return FALSE;
  }
}

If I remove the conditional statement like this:

function mailbuild_soap_call($operation, $params) {
    $wsdl = variable_get('mailbuild_service_url', '');
    $client = new nusoap_client($wsdl, TRUE);
    $result = $client->call($operation, $params);
    return $result;
}

I get - Fatal error: Class 'nusoap_client' not found.

I'm using NuSOAP 0.7.3 which looks like it has the PHP5 fixes in it. It's placed correctly in nusoap/lib folder and Mailbuild Module config is finding it.

Once again thx for your help :-)

Zap

benkant’s picture

Hi Zap,

The if statement you removed includes the NuSOAP library. Perhaps try this:

function mailbuild_soap_call($operation, $params) {
  if (@include_once(realpath(mailbuild_nusoap_path()))) {
    $wsdl = variable_get('mailbuild_service_url', '');
    $client = new nusoap_client($wsdl, TRUE);
    if ($err = $client->getError()) {
      die('error creating soap client object: ' . $err);
    }
    $result = $client->call($operation, $params);
    if ($err = $client->getError()) {
      die('error calling service: ' . $err);
    }
    return $result;
  }
  else {
    return FALSE;
  }
}

Let me know how it goes :)

Firetracker’s picture

Status: Active » Closed (fixed)

Hi,

Okay - feeling a bit dumb!

The NuSOAP Path must be full and include nusoap.php in the path. i.e.

sites/all/modules/contrib/mailbuild/nusoap/lib/nusoap.php

I had the following NuSOAP Path:

sites/all/modules/contrib/mailbuild

However the:

  if (file_exists(mailbuild_nusoap_path())) {
    $status = t('NuSOAP library found.');
  } else {
    $status = t('NuSOAP library not found.');
  }  

in mailbuild_admin_settings_form still passes my 'bad' path as okay.

Once again thx for your help. I'm closing this :-)

dragonwize’s picture

Thanks for your work Ben and Zapple. We will get a fix for this committed.