-
Notifications
You must be signed in to change notification settings - Fork 13
/
edit.php
32 lines (29 loc) · 989 Bytes
/
edit.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
$soapURL = "http://localhost:8080/ws/services/AssetOperationService?wsdl";
$client = new SoapClient
(
$soapURL,
array ('trace' => 1, 'location' => str_replace('?wsdl', '', $soapURL))
);
$auth = array ('username' => 'admin', 'password' => 'admin' );
$identifier = array
(
'path' => array('path' => '/my-xml-block', 'siteName'=> 'nameOfSite'),
'type' => 'block'
);
$readParams = array ('authentication' => $auth, 'identifier' => $identifier);
$reply = $client->read($readParams);
if ($reply->readReturn->success=='true')
{
$xmlBlock = $reply->readReturn->asset->xmlBlock;
$xmlBlock->metadata->title="A new title";
$editParams = array ('authentication' => $auth, 'asset' => array('xmlBlock' => $xmlBlock));
$reply = $client->edit($editParams);
if ($reply->editReturn->success=='true')
echo "Success.";
else
echo "Error occurred when issuing an edit: " . $reply->editReturn->message;
}
else
echo "Error occurred when reading: " . $reply->readReturn->message;
?>