I'm learning to use the SOAP service but have struck a problem. I can create and modify an asset, but when I try to use SetMetadataSchema to associate a metadata schema with an asset I strike an error.
For example the following PHP code:
$client = new SoapClient("http://matrixdemo.squiz.net/_web_services/soap?WSDL", array('cache_wsdl' => WSDL_CACHE_NONE));
$client->SetMetadataSchema(array('AssetID'=>'317', 'SchemaID'=>'207', 'Grant'=>'Apply'));
returns the error:
[SOAP-ENV:Server] Unable to set Workflow Schema on Asset
The asset and schema ids are both correct, and I can manually set the metadata schema in the gui.
The SOAP Metadata services are setup and accessible. Other metadata operations work ok. For example, if I manually set the schema, I can then use SetAssetMetadata to set individual fields without a problem.
I'm learning to use the SOAP service but have struck a problem. I can create and modify an asset, but when I try to use SetMetadataSchema to associate a metadata schema with an asset I strike an error.
For example the following PHP code:
$client = new SoapClient("http://matrixdemo.squiz.net/_web_services/soap?WSDL", array('cache_wsdl' => WSDL_CACHE_NONE));
$client->SetMetadataSchema(array('AssetID'=>'317', 'SchemaID'=>'207', 'Grant'=>'Apply'));
returns the error:
[SOAP-ENV:Server] Unable to set Workflow Schema on Asset
The asset and schema ids are both correct, and I can manually set the metadata schema in the gui.
The SOAP Metadata services are setup and accessible. Other metadata operations work ok. For example, if I manually set the schema, I can then use SetAssetMetadata to set individual fields without a problem.
What am I missing?
Thanks, Tim
[/quote]
Can you see any errors in error.log found at data/private/logs/error.log ?
Looks like the HIPO is returning some sort of error because of which the request is failing.
Thanks - I wasn't sure where to look for errors. I've worked it out now – it was a permissions problem.
SetMetadataSchema requires Admin permission. I thought that because I'd given the Public User read/write/admin permissions through SOAP that this wouldn't be a problem, but I also needed admin permission on the asset itself. All I had to do was apply admin permission to the parent asset and set cascade to true. Now when I create an asset though SOAP under that parent asset it has the necessary permissions and I can at last set the metadata schema.