Please help, desperately need help with SOAP

I’m new to SOAP and am trying to adapt it to use it with NUSOAP but don’t know how to get the GetAddressBooks results from this page but am not having any luck. I’ve spoken to dotmailer who said that they don’t offer technical support for php (which is great as we’re paying a lot for this). So far I’ve got this, but all that I get from that is 1000100000 which is the output from the v2:select etc fields. It should be outputting.

	  <?php
# initialise
$error_message="Something went wrong";
$wsdlPath = "https://apiconnector.com/v2/api.svc?wsdl";

# perform lookup
  require $INSTALL['include']."/nusoap/lib/nusoap.php";
  $client=new soapclient( $wsdlPath,'wsdl' );
  $client->soap_defencoding = 'UTF-8';
  $client->setCredentials("username","password");
  $err=$client->getError();
  if( $err ) { echo $error_message; exit( $err ); }
  
  # create a proxy client.
  $proxy=$client->getproxy();
  $err=$proxy->getError();
  if( $err ) { echo $error_message; exit( $err ); }
  
  # call the SOAP method for GetAddressBooks.
  $result=$proxy->GetAddressBooks(array('select' => 100));
  if( $proxy->fault ) {
    echo $error_message;
  } else {
    $err=$proxy->getError();
    if( $err ) {
      echo $error_message; exit( $err );
    } else {

      AddressBooks( $result );
    }
  }
  
  function AddressBooks( $result ) {
	  print '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://apiconnector.com/v2">';
	  print '<soapenv:Header/>';
	  print '<soapenv:Body>';
	  print '<v2:GetAddressBooks>';
	  print '<v2:select>100</v2:select>';
	  print '<v2:skip>0</v2:skip>';
	  print '</v2:GetAddressBooks>';
	  print '</soapenv:Body>';
	  print '</soapenv:Envelope>';

	  print '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://apiconnector.com/v2">';
	  print '<soapenv:Header/>';
	  print '<soapenv:Body>';
	  print '<v2:GetAddressBooksResponse>';
	  print '<v2:Id>100</v2:Id>';
	  print '<v2:Name>0</v2:Name>';
	  print '<v2:Visibility>0</v2:Visibility>';
	  print '<v2:Contacts>0</v2:Contacts>';
	  print '</v2:GetAddressBooksResponse>';
	  print '</soapenv:Body>';
	  print '</soapenv:Envelope>';
  }
  
  ?>

If I use var_dump($proxy); then it give around 3mb worth of text that has everything to do with our account (such as users, imports, etc) but towards the bottom it has what looks like what I’m after. It says:

[21]=> array(4) { [“Id”]=> string(6) “966830” [“Name”]=> string(14) “Address Book - Internal” [“Visibility”]=> string(7) “Private” [“Contacts”]=> string(3) “90” }

but how do I get to show on a web page that doesn’t look confusing to somebody looking at it?

I’ve spent nearly two months trying to get this to work now and am desperate for help please.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.