Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $proxy = new SoapClient('http://rudi.rudi.dev/berbatik/api/soap/?wsdl');
- echo "Login...\n";
- $sessionId = $proxy->login('sysadmin', 'admin123');
- echo "Loading...\n";
- $newImage = array(
- 'file' => array(
- 'name' => 'ImageTemp',
- 'content' => base64_encode(file_get_contents('ImageTemp.jpg')),
- 'mime' => 'image/jpeg'
- ),
- 'label' => 'Cool Image Through Soap',
- 'position' => 2,
- 'types' => array('small_image'),
- 'exclude' => 0
- );
- $imageFilename = $proxy->call($sessionId, 'product_media.create', array('K01', $newImage));
- var_dump($imageFilename);
- // Updated image file
- var_dump($proxy->call($sessionId, 'product_media.list', 'K01'));
- ?>
Advertisement
Add Comment
Please, Sign In to add comment