Re: [SOAP] SOAP PEAR Module - Array Issues

[email protected] (Jeffery Fernandez)
Newsgroups php.soap
Organization Internet Vision Technologies
Message-ID <[email protected]>
Ross,

try the example shown below. I am not using PEAR soap library but the standard PHP library:

<?php

error_reporting(E_ALL);

// Do not cache the WSDL file <- good for developing/bad for production
$ini = ini_set("soap.wsdl_cache_enabled","0");


try {
	$options = array(
		'trace' => true, 
		'exceptions' => true, 
		'soap_version' => SOAP_1_1
	);
	
	$client = new SoapClient("http://api.emaildirect.com/v3/api.asmx?WSDL", $options);
	//print_r($client);
	
        // Build the parameters
	$parameter = array(
		'AccountName' => 'test',
		'APIPassword' => '123456',
		'Email' => '[email protected]',
		'SourceID' => '',
		'PublicationIDs' => array(array('int' => 2), array('int' => 3)),
		'ListIDs' => array(array('int' => 2), array('int' => 3)),
		'AutoResponderID' => '',
		'CustomFields' => array(
			array('CustomField' => 
				array('FieldName' => '', 'Value' => '')
			)
		)
	);	
        // Call the Email Force Addition function
	$client->Email_ForceAddition($parameter);
	
        // Shows the Request and Response in XML
	echo("<br />REQUEST :<br />" . 
		htmlspecialchars($client->__getLastRequest()) . "<br />");
	echo("<br />RESPONSE:<br />" .
		htmlspecialchars($client->__getLastResponse()) . "<br />");	
}
catch (SoapFault $ex)  // Catch any errors and do appropriate debugging
{
	echo "Error:<br />" . nl2br($ex->faultcode) . '<br /><br />';
	echo 'Error Details:<br />'. nl2br($ex->faultstring) . '<br />';
	echo("<br />REQUEST :<br />" . 
		htmlspecialchars($client->__getLastRequest()) . "<br />");
	echo("<br />RESPONSE:<br />" .
		htmlspecialchars($client->__getLastResponse()) . "<br />");	
}
?>

They above should work provided you give the right Account name and API Password.

cheers,
Jeffery Fernandez

On Fri, 6 Jun 2008 06:14:22 am Ross King II wrote:
> I am using the SOAP Package and have an issue.
>
[snip]



-- 
Internet Vision Technologies
Level 1, 520 Dorset Road
Croydon
Victoria - 3136
Australia
web: http://www.ivt.com.au
phone: +61 3 9723 9399
fax: +61 3 9723 4899
signature.asc (application/pgp-signature, 194 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4-svn0 (GNU/Linux)

iD8DBQBITgBK5WXEviRz51oRAnVHAJ9Ttu1MzqSj7H78EH0ZOsxA/SO7zwCeLxac
pJfbMNjJrb4EUJV9jRZK1xI=
=JEv7
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.