Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require('exacttarget_soap_client.php');
- $wsdl = 'https://webservice.exacttarget.com/etframework.wsdl ';
- try {
- $client = new ExactTargetSoapClient($wsdl, array('trace'=>1));
- $client->username = 'myUsername';
- $client->password = 'myPassword';
- $port = new ExactTarget_Portfolio();
- $port->DisplayName = 'API Uploaded Test v10';
- $port->CustomerKey = 'API Uploaded Test v10';
- $rs = new ExactTarget_ResourceSpecification();
- $rs->URN = 'http://email.exacttarget.com/myFolder/myFile.jpg'; //not sure if this is right
- $port->Source = $rs;
- $port->FileName = 'myFile.jpg'; //file in the same folder as the php file
- $object = new SoapVar($port, SOAP_ENC_OBJECT, 'Portfolio', "http://exacttarget.com/wsdl/partnerAPI ");
- $request = new ExactTarget_CreateRequest();
- $request->Options = NULL;
- $request->Objects = array($object);
- $results = $client->Create($request);
- print_r($results);
- } catch (SoapFault $e) {
- print_r($e);
- }
- ?>
- Warning: DOMDocument::loadXML(): xmlns:ns2: 'http://exacttarget.com/wsdl/partnerAPI ' is not a valid URI in Entity
- $object = new SoapVar($port, SOAP_ENC_OBJECT, 'Portfolio', "http://exacttarget.com/wsdl/partnerAPI ");
- $port->FileName = 'myFile.jpg'; //file in the same folder as the php file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement