Monday, January 17, 2011

Failed to retrieve the AzMan Scope

Hi Fellows,
Yesterday, I was creating a Commerce Server environment which was to co-exist in a existing MOSS installation on the same box.

NOTE: Bare in mind folks, if you have DC and MOSS on the same box, I would not recommend installing Commerce Server on to the same box. DC makes Commerce Server impossible to work. My recommendation keep DC separate and then you may install Commerce and MOSS on the same machine/VM/box.

While restoring Commerce Server I faced a strange issue whereby web-services (catalog/marketing/orders/profiles) seem to work fine and correctly opened up in browser. However after configuring business application with corresponding web-services, Catalog Manger threw error when clicking to expand product catalog.


Solution: (Provided by: http://microsoftblog.co.in/commerceserver/filed-to-retrieve-the-azman-scope/)
Follow below steps to fix this problem.
  • Open CatalogAuthorizationStore.xml file in Authorization manager.
  • Right click on “CatalogandInventorySystem” and select “New Scope”.
  • Give scope name as “CatalogScope_CatalogName” – In our context it’s “CatalogScope_Books”.
  • Right click on "Task Definitions" and click on "New Task Definition". Click "Add" button and select appropriate tasks & operations.
  • Right click on "Role Defintions" and click on "New Role Definiton". Click "Add" button and select appropriate roles.
  • Right click on "Role Assignments" and click on "New Role Assignment". Select appropriate roles and press OK button.
  • Make sure you add your windows id to the role also the service account used by your web application using Azman.msc
Cheers,

Commerce Server 2007 - Fetch Product Catalog

Hi Fellows,

Been quiet a while since I blogged last. These days am understanding nuts and bolts of another Microsoft Product i.e. Microsoft Commerce Server 2007/2009 and how they sync with Microsoft SharePoint Server 2009. Watch out for my up-coming blogs on Commerce Server.

Just to give you guys a Sneak Peak of what I have done so far, take a look at the code below which gets you Product Catalog Object by using Catalog System API's:

[CODE]
internal static ProductCatalog GetCSCatalog(String SiteName, String AuthorizationPolicyPath, String CatalogName)
{

try
{
//Accessing the site agent of a hypotheticla site BuyOnline
CatalogSiteAgent catalogSiteAgent = new CatalogSiteAgent();
catalogSiteAgent.SiteName = SiteName;
//Here its assumed that the context under which the method runs
// is already added in the AZMAN for the catalog web service
catalogSiteAgent.AuthorizationMode = AuthorizationMode.ThreadContext;
catalogSiteAgent.AuthorizationPolicyPath = AuthorizationPolicyPath;
//Inventory subsytem being ignored
catalogSiteAgent.IgnoreInventorySystem = true;

//configure the caching parameters
CacheConfiguration cacheConfiguration = new CacheConfiguration();
cacheConfiguration.CacheEnabled = true;

//Get the catalog context for the current site
CatalogContext catalogContext =
CatalogContext.Create(catalogSiteAgent, cacheConfiguration);

ProductCatalog cd = catalogContext.GetCatalog(CatalogName);

return cd;
}
catch (Exception ex)
{
throw (ex);
}
}
[/CODE]