1

While creating bundle using core service I am getting following exception: Unable to find http://www.mycompanyname.com/tridion/schema/prodpublish_bundle_schema:Metadata.

I am following below process:

  1. Reading what type (prod publish or prod unpublish) of bundle I have to create.

    SchemaData bundleSchema =(SchemaData)TridionCoreServiceFactory
         .CreateCoreService().Read("tcm:222-21051-8", _ReadOption);
    
  2. getting Virtual folder type scheam as Bundle

    SchemaData virtualFolderTypeSchema = TridionCoreServiceFactory.CreateCoreService()
         .GetVirtualFolderTypeSchema(@"http://www.sdltridion.com/ContentManager/Bundle");
    
  3. Creating new VirtualFolder and setting propties to make it Bundle

    VirtualFolderData bundle = new VirtualFolderData()
    {
        MetadataSchema = new LinkToSchemaData(){IdRef = bundleSchema.Id},
        TypeSchema = new LinkToSchemaData(){IdRef = virtualFolderTypeSchema.Id},
        //setting other properties like name ,description, location etc. 
    }
    

With the above code Core Service is trying to find namesapce used in provided MetadataSchema and ending with error

Unable to find http://www.mycompanyname.com/tridion/schema/prodpublish_bundle_schema:Metadata.

When I checked source of BundleType 'prodpublish_bundle' it really has thenamespace

  <xsd:schema
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://www.mycompanyname.com/tridion/schema/prodpublish_bundle_schema"
    xmlns:tcmi="http://www.tridion.com/ContentManager/5.0/Instance"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    elementFormDefault="qualified"

targetNamespace="http://www.mycompanyname.com/tridion/schema/prodpublish_bundle_schema">

1 Answer 1

3

You've set the Metadata schema, but not the Metadata itself. If metadata schema is set you should always set the metadata as well, even if schema has no mandatory fields. It should at least contain the namespace, of the metadata schema.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.