-
Notifications
You must be signed in to change notification settings - Fork 13
/
copy.php
40 lines (35 loc) · 924 Bytes
/
copy.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
33
34
35
36
37
38
39
40
<?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'
);
$destFolderIdentifier = array
(
'path' => array('path' => '/my-folder', 'siteName' => 'nameOfSite'),
'type' => 'folder'
);
$copyParams = array
(
'authentication' => $auth,
'identifier' => $identifier,
'copyParameters' => array
(
'destinationContainerIdentifier' => $destFolderIdentifier,
'doWorkflow' => false,
'newName' => 'my-xml-block-copy',
)
);
$reply = $client->copy($copyParams);
if ($reply->copyReturn->success=='true')
echo "Success.";
else
echo "Error occurred when copying: " . $reply->copyReturn->message;
?>