我正在http://help.exacttarget.com/en/technical_library/web_service_guide/api_starter_kits/使用Exact Target PHP API入门套件,并尝试使用示例代码进行连接。作为参考,这是提供的示例代码:
<?php
echo '<pre>';
require('../../00 Includes/exacttarget_soap_client.php');
<?php
echo '<pre>';
require('../../00 Includes/exacttarget_soap_client.php');
$wsdl = 'https://webservice.s6.exacttarget.com/Service.asmx';
try{
/* Create the Soap Client */
$client = new ExactTargetSoapClient($wsdl, array('trace'=>1));
/* Set username and password here */
$client->username = '<ommitted>';
$client->password = '<omitted>';
$request = new ExactTarget_RetrieveRequest();
$objectType= "Subscriber";
$request->ObjectType= $objectType;
$request->Properties = array("ID","PartnerKey","CreatedDate","Client.ID","Client.PartnerClientKey","EmailAddress","SubscriberKey","UnsubscribedDate","StatusSubscriberStatus");
// Filter retrieve on a particular email address
$filter1 = new ExactTarget_SimpleFilterPart() ;
$filter1->Property= "EmailAddress";
$filter1->SimpleOperator=ExactTarget_SimpleOperators::equals;
$filter1->Value=array("info@exacttarget.com"); //email address to filter on
$request->Filter = new SoapVar($filter1, SOAP_ENC_OBJECT, 'SimpleFilterPart', "http://exacttarget.com/wsdl/partnerAPI");
$requestMsg = new ExactTarget_RetrieveRequestMsg();
$requestMsg->RetrieveRequest=$request;
$results = $client->Retrieve($requestMsg);
/* Output the results */
echo 'Results:';
var_dump($results);
} catch (SoapFault $e) {
/* output the resulting SoapFault upon an error */
var_dump($e);
}
/* Output the request and response */
print "Request: \n". $client->__getLastRequestHeaders() ."\n";
print "Request: \n".
$client->__getLastRequest() ."\n";
print "Response: \n".
$client->__getLastResponseHeaders()."\n";
print "Response: \n".
$client->__getLastResponse()."\n";
echo '</pre>';
?>
当我运行此代码时,我发现了一条例外消息:
SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://webservice.s6.exacttarget.com/Service.asmx' : Entity 'nbsp' not defined
之前我使用过精确目标的API,并且有两个奇怪的事情:
还有其他人遇到过这个问题吗?
答案 0 :(得分:0)
对于s6实例,我需要将网址更改为https://webservice.s6.exacttarget.com/etframework.wsdl。此外,它看起来像入门套件有一些其他过时的代码。我提到了这个确切的目标,他们取下了php(非燃料)版本。