Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Set value for custom meta data
Jelle
Hello,
I'm trying to set the value for a custom metadata field using the mediabin webservices.
I'm using the ReviseAssetMetadata webservice method. When I try to update a buildin metadata field for my asset my code works fine. When I try to set the value for a field of a custom metadata, I'm getting following exception:
MBException: ERROR: Invalid operation. (0x8004045A).
I'm using the following code (C#)
MBMetadata metadata = new MBMetadata();
metadata.mID = metadataID;
metadata.mValue = value;
bool returnValue = false;
returnValue = this.Server.ReviseAssetMetadata(assetID, new MBMetadata[] { metadata });
What am I doing wrong?
Kind regards,
Jelle
Find more posts tagged with
Comments
msrinivas
The example application provided with MB 4.6 web services has exactly what you are looking for.
If it is happening for custom metadata field then I would check the permissions and also what type of metadata field it is.
HTH
lyman
This message can also occur if you are trying to revise the metadata on an asset just after insertion (i.e., the time between which an asset is queued for insertion and the time the asset has completed inserting). Is there any chance you are in this situation?
MediaBin keeps a placeholder "pending" image in the repository to hold teh name and allow clients to display an empty frame saying that an asset is coming, but you cannot perform any operations on it yet.
Cheers,
Lyman Hurd
Jelle
Thanks for your replies.
I checked the example application, but the code to update a metadata field is exactly the same as the code I use.
I checked the permissions on the metadata field and everybody had change rights. I'm running my code as (mediabin) administrator, so I think I have all necessary rights in Mediabin.
In my code I am just creating placeholders. The image-files will be uploaded later on by an other application. I tried adding a sleep to test the possibility that the exception occurs because of the insert job, but without success. Changing system metadata fields succeeds without a problem.
Is there a list with the error codes?
Can I check a logfile of the mediabin webservices somewhere?
Do you have other suggestions?
Thanks,
Jelle
msrinivas
Can you post your code (block)?
shakilxy
MBMetadata[] customMetadata = new MBMetadata[1];
try{
customMetadata[0] = new MBMetadata();
customMetadata[0].setMName("CONV_FLOORPLAN_TYPE");
customMetadata[0].setMValue("F35B");
boolean success = mMediaBinServer.reviseAssetMetadata(alleCustomerAssets.get(0).getMID().toString(), customMetadata);
if(success)
System.out.println("Done Done");
else
System.out.println("Not ye Done....Check again");
}
catch(Exception e)
{
System.out.println(" No Metadata set -> " +e);
}
Here I am getting an error
No Metadata set -> System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> MBPNetModel.MBObjects.MBException: MBException: The requested object does not exist. (0x80040405)
at MBPNetModel.MediaBinScriptModel.MediaBinServerImpl.ReviseAssetMetadata(String assetID, MBMetadata[] metadataArray, MBConnection mbConnection)
at MBPNetModel.WebServices.MediaBinServer.ReviseAssetMetadata(String assetID, MBMetadata[] metadataArray)
--- End of inner exception stack trace ---
Just to give an Idea about what i want to do is -->
I have already created a custom metedata "CONV_FLOORPLAN_TYPE" using the Metadata Manager. Now this metadata will have different values for diferrent assets. All these assets also have the buildin Metadata but i dont want to touch those. What i want to do is just set new values to custom metadata "CONV_FLOORPLAN_TYPE".
There are @ 4000 assets. So I have retrieved all these assets in a list arraylist "alleCustomerAssets"
Can some one let me know what is wrong here? What should i do to just set a new value to a already defined custom metadata trough webservices?
Thanks....Shakil
lyman
What version of MediaBin are you running?
Also, is there any possibility that you are looking at assets that have been deleted (i.e., are in the Deleted Items folder or one of its subfolders)? One source of errors is when people run recursive scripts as an admin and descend into this directory where very few operations are ocnsidered legal (with basically the sole exception of moving something out!).
Cheers,
Lyman Hurd