Archive for May 2008

Microsoft has release Commerce Server 2007 service pack 2, which provides following functionality.

  • Support of running Commerce Server 2007 on windows server 2008 with full support of IIS 7.0 when it is configured in classic or integrated pipeline mode. 
  • Support working on Microsoft Vista SP1. 
  • Fixes to performance & security issues 
  • It includes compatibility with Visual Studio 2008, .NET 3.5. 
  • Note: No new features are introduced in SP2.  Installing SP2 on non-English versions of Commerce Server 2007 is not supported. 

Here are the links for SP2 download 

Commerce Server 2007 Starter Site Release 2
http://www.microsoft.com/downloads/details.aspx?FamilyId=10F9C18E-3E15-4AB9-9C40-A424876D1630&displaylang=en 

Commerce Server 2007 Service Pack 2 – Standard Edition
http://www.microsoft.com/downloads/details.aspx?FamilyId=5E150DFB-16D7-41E2-A315-3B8833311832&displaylang=en 

Commerce Server 2007 Service Pack 2 – Enterprise Edition
http://www.microsoft.com/downloads/details.aspx?FamilyId=9A50CFDC-E983-4359-86DE-5AE9F6A5A806&displaylang=en 

Commerce Server 2007 SP2 Partner SDK
http://www.microsoft.com/downloads/details.aspx?FamilyId=0386DD2F-3A96-4033-A326-207351014DB1&displaylang=en 

Documentation refresh
http://www.microsoft.com/downloads/details.aspx?FamilyId=DF6915DC-047E-443D-8E25-DB331CBC87BA&displaylang=en   

Related Articles


If you like this post, please click on our sponsor advertisement.


Ecommerce application needs product updates daily or frequently to show up to latest products information on their website. Sometimes the product information gets from company business users and sometimes the products information comes from vendors. For large scale ecommerce application, middleware servers like BizTalk are used for product import.

This current tool (attached to this article) is command based tool and be perfect for small companies with limited data upload and can be used only one time (during application migration) or regularly. This tools takes catalog data using excel file and through commerce server API, it inserts data into database.

The excel file template contains three sheets.

1.    First sheet name  is “CategoryData” – This sheet contains categories details.
2.    Second sheet name is “ProductData” – This sheet contains product details.
3.     Third Sheet name is “VariantData” – This sheet contains variant data.

Note: Kindly don’t change sheet names.

When the tool is executed, it will ask for data excel file path. Once correct path is provided, it will ask whether to import category data, product data or variant data. Based on the option selected, the tool starts porting data into commerce server.

The assumption is that the given catalog and product definition are created in commerce server.

How to add a category?

Category can be created under a Catalog only. So, before we create category, the application should get context of Catalog, then by using method CreateCategory(), category can be created.

BaseCatalog baseCatalog = (BaseCatalog)context.GetCatalog((string)row["CatalogName"]);
Category category = baseCatalog.CreateCategory((string)row["CategoryDefinition"], (string)row["CategoryName"]);
category.DisplayName = (string)row["DisplayName"];
category.Save();

How to add a Product?

Product can be created under catalog or category. So before we create product, the application should get catalog context. By using CreateProduct(), a product can be created. If the products need to be created under a category, then pass category information to CreateProduct() method.

BaseCatalog baseCatalog = (BaseCatalog)context.GetCatalog((string)row["CatalogName"]);
Product product = baseCatalog.CreateProduct((string)row["ProductDefinition"], (string)row["ProductID"], Convert.ToDecimal(row["ListPrice"]), (string)row["CategoryName"]);
product.DisplayName = (string)row["DisplayName"];
product["Image"] = row["Image"];
product["Description"] = row["Description"];
product.Save();

How to add a variant?

Products may or may not have a variant. For example, a shoe can have multiple variants like size, color, etc and some products don’t have variants like Books. To create a variant, the application should get product definition and to get product definition, the application needs to get catalog context. Once product definition obtained, we can add a new variant using AddVariant() method as shown below.

BaseCatalog baseCatalog = (BaseCatalog)context.GetCatalog((string)row["CatalogName"]);
ProductFamily productFamily = (ProductFamily)baseCatalog.GetProduct((string)row["ProductID"]);string variantID = (string)row["VariantID"];
// Add the variant to the product family.
productFamily.AddVariant(variantID);
// Set the properties for the variant product. 
productFamily.Variants[variantID]["VariantActualPrice"] = Convert.ToDecimal(row["VariantListPrice"]);
productFamily.Variants[variantID]["Color"] = (string)row["VariantColor"];
productFamily.Variants[variantID]["Size"] = (string)row["VariantSize"]
productFamily.Variants[variantID]["VariantDisplayName"] = (string)row["VariantDisplayName"];
productFamily.Save();

If you have any questions/suggestions on his approach, feel free to send your comments. Click here to download Catalog Importer.

Related Articles


If you like this post, please click on our sponsor advertisement.


While developing code to store credit card information in commerce server profile, I used to get a error message – “Failed to set value for profile property ‘cc_number’ at Microsoft.CommerceServer.Runtime.Profiles.ProfileProperty.set_Value(Object value) at MyProject. AddUserCreditCard(CreditCard creditCard, String authTicket)”

It looks strange error but this error comes because of two reasons

1.    Invalid encryption keys
2.    Invalid settings in web.config.

 Commerce Server Profile system gives the flexibility to store sensitive information like credit card details, personnel details. It uses asymmetric cryptography (public-key cryptography) to encrypt / decrypt sensitive information. Asymmetric cryptography contains two keys

1.    Public key
2.    Private key

The private key is kept secret, while the public key may be widely distributed. Incoming messages would have been encrypted with the recipient’s public key and can only be decrypted with his corresponding private key. For better security of these keys, commerce server keeps them in registry. A site can have one entry of public/private key in the registry or they can share the key details with another site. You can find the key details at

HKEY_LOCAL_MACHINESOFTWAREMicrosoftCommerce Server 2007 Keys

Make sure there are valid keys in the registry. If you feel the keys are corrupted or tampered, you can use “ProfileKeyManager.exe” tool to generate a new set of keys.

The second place to check the settings at web.config. Make sure your application (from which you are calling commerce server profile subsystem) web.config has following details. 

<profiles><userProfile profileDefinition=”UserObject”userIdProperty=”GeneralInfo.email_address” organizationIdProperty=”AccountInfo.org_id” catalogSetIdProperty=”AccountInfo.user_catalog_set” userIdSource=”UPM” userIdKey=”GeneralInfo.email_address” userIdTarget=”GeneralInfo.user_id”/>
<organizationProfile profileDefintion=”Organization” organizationIdProperty=”GeneralInfo.org_id” catalogSetIdProperty=”GeneralInfo.org_catalog_set”/><encryption>
<keys keyIndex=”1″>
<add type=”publicKey” value= “registry:HKEY_LOCAL_MACHINESOFTWAREMicrosoftCommerce Server 2007 KeysDefault,PublicKey” />
<add type=”privateKey1″ value=”registry:HKEY_LOCAL_MACHINESOFTWAREMicrosoftCommerce Server 2007 KeysDefault,PrivateKey” />
</keys>
</encryption>
</profiles> 

Make sure you update Default with exact site/folder name in your web.config else you will get “Configuration error”, when you run the application. It’s good practice to change public and private keys once in 90 days. On every key change, its IT administrator responsibility to update the sensitive data is compatible with new keys else the data will become void. Watch out for this space for data migration tool.

Related Articles


If you like this post, please click on our sponsor advertisement.


For past couple of years, I have worked on couple of ecommerce projects where the ecommerce front end was developed using ASP.NET and flash and integrates with commerce server 2007 through API/web services. I have delivered nice look and feel portals with good usability features. Most of the people don’t know about integration of flash & commerce server to create nice and good looking ecommerce applications. From my perspective, the main disadvantage with this approach is designer dependency. As a programmer, I have limited visibility till commerce server and involvement into flash UI design is nil or very little. The graphic designers don’t have much knowledge on technical aspects and they don’t understand what information they need to make the site work.  It is developer responsibility to analyze the data, think on all abilities (scalability, performance, extensibility, etc) before the development/design work starts.

One year before, Microsoft has come up with Silverlight (v1.1 alpha). I personally feel this software as flash competitor.  The advantage of Silverlight is the frontend code is created in XAML and the code behind using C#.NET. This makes me (as a developer) very happy as I have total control on UI code. At the maximum, I will reach graphic designer for look and feel and rendering graphics, animations are within my control.

Recently I has developed a small ecommerce application using Silverlight 1.1 (alpha). It’s a nightmare to build end to end application where Silverlight doesn’t support many of the core development features (like controls, grids, UI panels, etc) and in the month of March Microsoft has released new version of Silverlight 2.0 (beta). This software was far better than older version as it provides user controls to build applications similar to ASP.NET.  To my surprise, when I decided to migrate current application to new version, I found there are lot of architecture changes and finally end up in creating the code from the scratch.

Some of the key problems I still feel from Silverlight are

1.       Web service calls are asynchronous. This makes the application run slower.

2.       All the features of WPF are not supported by Silverlight.

3.       Silverlight 2.0 guide states the support of WCF but it is nightmare to implement.

4.       The Silverlight controls are heavy and take time to download on client browsers.

5.       Error happened in web services cannot be catch at Silverlight component.

One thing we should keep in mind that Silverlight 2.0 software is still in beta and I see in next two years it will overcome flash and provide all features supported by WPF. If you have any questions/suggestions, kindly raise them through comments section.

Related Articles


If you like this post, please click on our sponsor advertisement.


Follow me on Google+
Add to circles

In 0 people's circles

Sign up for Newsletter