Advertisement
Guest User

Untitled

a guest
Apr 17th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. <?php
  2. require('exacttarget_soap_client.php');
  3. $wsdl = 'https://webservice.exacttarget.com/etframework.wsdl ';
  4.  
  5. try {
  6.  
  7. $client = new ExactTargetSoapClient($wsdl, array('trace'=>1));
  8. $client->username = 'myUsername';
  9. $client->password = 'myPassword';
  10.  
  11. $port = new ExactTarget_Portfolio();
  12. $port->DisplayName = 'API Uploaded Test v10';
  13. $port->CustomerKey = 'API Uploaded Test v10';
  14. $rs = new ExactTarget_ResourceSpecification();
  15. $rs->URN = 'http://email.exacttarget.com/myFolder/myFile.jpg'; //not sure if this is right
  16. $port->Source = $rs;
  17. $port->FileName = 'myFile.jpg'; //file in the same folder as the php file
  18. $object = new SoapVar($port, SOAP_ENC_OBJECT, 'Portfolio', "http://exacttarget.com/wsdl/partnerAPI ");
  19.  
  20. $request = new ExactTarget_CreateRequest();
  21. $request->Options = NULL;
  22. $request->Objects = array($object);
  23.  
  24. $results = $client->Create($request);
  25. print_r($results);
  26.  
  27. } catch (SoapFault $e) {
  28. print_r($e);
  29. }
  30. ?>
  31.  
  32. Warning: DOMDocument::loadXML(): xmlns:ns2: 'http://exacttarget.com/wsdl/partnerAPI ' is not a valid URI in Entity
  33.  
  34. $object = new SoapVar($port, SOAP_ENC_OBJECT, 'Portfolio', "http://exacttarget.com/wsdl/partnerAPI ");
  35.  
  36. $port->FileName = 'myFile.jpg'; //file in the same folder as the php file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement