Archive for the ‘Commerce Server’ Category.

The Future Of Commerce Server

A quick note about the Ascentium/Microsoft buzz about Commerce Server, here’s an official press release from Ascentium. And here it is again on their site.

How To Get The Commerce Server Extensibility Kit Deployment Friendly

When you first start out developing for Commerce Server 2009 R2, you notice there are quite a large amount of code that they provide you to get started with.

Where To Start:
First you need to find the CommerceSharePointExtensibilityKit.zip file located at C:\Program Files (x86)\Microsoft Commerce Server 9.0\Extensibility Kits
In this file you’ll see two Visual Studio solution files. I’m a fan of VS2010, so we’ll work with that, although it isn’t what these solutions were meant for.

Open the SharePointCommerce solution. Allow Visual Studio to do it’s conversion. You’ll now need to add the two other projects Common and SharePointCommon. They are located in the named directories from the base solution directory, you shouldn’t have any issues finding them.

Create your own SNK file:
Create a small console application with a SNK of your own choosing. Add signing to the project, then retrieve the PublicKeyToken for later use.

Replace the SNK file:
Copy your SNK file over the built in file MSSharedLibSN1024.snk, don’t delete rename, this will just create more work for you later.

Perform the following Search and Replace Operations within all files in the solution:

Search For:
Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35

Replace With:
Version=1.0.0.0, Culture=neutral, PublicKeyToken=<YourKeyHere>

Search For:
Culture=Neutral, Version=1.0.0.0, PublicKeyToken=31bf3856ad364e35

Replace With:
Culture=Neutral, Version=1.0.0.0, PublicKeyToken=<YourKeyHere>

Manually Edit this file:
CommerceSharePointExtensibilityKit\SharePointCommon\FeatureActivation\CommerceFeatureActivationJobDefinition.cs Line: 1836
"Microsoft.CommerceServer.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=<YourKeyHere>

Replace with:
"Microsoft.CommerceServer.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

Now you will be able to build the entire solution, create the three WSP’s used by the custom installer, and use their handy tool to provision the site.

Commerce Server 2009 R2 RTM

So I received my regularly scheduled MSDN Flash newsletter, Volume 15, Number 19. I look in the new software available and it’s showing Commerce Server 2009 R2. I signed in to MSDN and there it was located under new downloads.

I haven’t heard any announcement other than that.

I will see what I can find out and post more… But the Standard and Enterprise editions are both there for download.

Security Token with the Commerce Claim Operation

So I just recently spun up a new virtual machine to do some Commerce Server 2009 R2 work. Did all my standard installation work, everything seemed good.

Then when I went to view the site, I get the following error:

An exception occurred when trying to issue security token: User DOMAIN\USERNAME is not authorized for the operation CommerceQueryOperation_CommerceClaim . Please open  CommerceEntityAuthorizationStore.xml in Authorization Manager and add the user to CommerceClaim\Role Assignments\CommerceQueryOperation.

The site was returning a 500 error, and this was all that was given in the event log. Since I needed a quick fix, this is only a development machine you know.

I turned to the channel configuration file, there is a new element called CommerceAuthorization, it was set to required.

Simply make the change here to Disabled, and the error will disappear…

Here is where to find the CommerceAuthorization element in the ChannelConfiguration.Config file.

image

Trouble Shooting Commerce Server 2009 Profile Extensions

This is the Exception that we will be looking at today:

The requested operation could not be performed because the CommerceEntity ‘CustomEntity’ does not map to a Commerce Server profile definition.

[FaultException`1: The requested operation could not be performed because the CommerceEntity 'TaxForm' does not map to a Commerce Server profile definition.]
Microsoft.Commerce.Providers.Utility.ProfileMetadata..ctor(CommerceEntityDefinition definition) +465
Microsoft.Commerce.Providers.Utility.ProfileMetadata.CreateProfileMetadata(MetadataCacheKey key, String modelName) +172
Microsoft.Commerce.Providers.Utility.<>c__DisplayClass5.<Get>b__4(MetadataCacheKey key) +54
Microsoft.Commerce.Application.Common.CachedFactory`2.GetOrCreate(TKey key, CreateInstance`2 factory) +435
Microsoft.Commerce.Providers.Utility.ProfileMetadata.Get(String modelName) +288
Microsoft.Commerce.Providers.Components.ProfileOperationSequenceComponent.get_Metadata() +89
Microsoft.Commerce.Providers.Components.ProfileOperationSequenceComponent.get_PrimaryKeyName() +40
Microsoft.Commerce.Providers.Components.RelatedProfileProcessorBase.ProcessQuery(CommerceQueryRelatedItem queryRelatedItem) +335
Microsoft.Commerce.Providers.Components.RelatedProfileOperationSequenceComponent.ExecuteQuery(CommerceQueryOperation queryOperation, OperationCacheDictionary operationCache, CommerceQueryOperationResponse response) +786
Microsoft.Commerce.Providers.Components.OperationSequenceComponent.Execute(CommerceOperation operation, OperationCacheDictionary operationCache, CommerceOperationResponse response) +348
Microsoft.Commerce.Providers.Components.ProfileOperationSequenceComponent.Execute(CommerceOperation operation, OperationCacheDictionary operationCache, CommerceOperationResponse response) +116
Microsoft.Commerce.Broker.OperationSequence.ExecuteComponentTree(List`1 executionTreeList, CommerceOperation operation, OperationCacheDictionary operationCache, CommerceOperationResponse response) +1040
Microsoft.Commerce.Broker.OperationSequence.Execute(CommerceOperation operation) +276
Microsoft.Commerce.Broker.MessageHandler.ProcessMessage(String messageHandlerName, CommerceOperation operation) +241
Microsoft.Commerce.Broker.OperationService.InternalProcessRequest(CommerceRequest request) +494
Microsoft.Commerce.Broker.OperationService.ProcessRequest(CommerceRequest request) +471
Microsoft.Commerce.Common.OperationServiceAgent.ProcessRequest(CommerceRequestContext requestContext, CommerceRequest request) +151

So I checked all of the standard things:

  1. Verified that ‘CustomEntity’ was setup correctly in Commerce Manager
  2. Ran a simple 2007 API based script to verify the relationship was setup correctly and that the ‘CustomEntity’ profile object was being returned correctly
  3. Checked the MetaDefinitions.xml and the ChannelConfiguration.config files to verify that they were indeed correct.
  4. Then I started scratching my head, I went over and over everything, and couldn’t figure out what was causing the problem.

Then I started using Reflector, in Visual Studio integrated mode, I choose the following assemblies to debug.

  • Microsoft.Commerce.Broker
  • Microsoft.Commerce.Common
  • Microsoft.Commerce.Contracts
  • Microsoft.Commerce.Providers

Then we start the debugging process and the exception occurs, but with out any indication as to why. Then I start stepping through the code and I notice a line in the Provider assembly.

 if (((target != null) && ProfileAssembly.Equals(target.get_CommerceServerAssembly(),
StringComparison.OrdinalIgnoreCase)) && ProfileTypeName.Equals(target.get_CommerceServerClass(),
StringComparison.OrdinalIgnoreCase))
          {
            return target;
          }

What this code is doing is essentially, checking the data we provided in our MetaDefinitions.xml file to make sure that it matches the assembly information.

  <!-- Custom Entity Start-->
            <CommerceEntity name="CustomEntity">
                <DisplayName value="Custom Entity" />
                <EntityMappings >
                    <EntityMapping
                                  csType="Microsoft.CommerceServer.Runtime.Profiles.Profile"
                                  csAssembly="Microsoft.CommerceServer.Runtime, Version=6.1.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                                  csDefinitionName="CustomEntity"
                                  csArea="Profiles">
                        <PropertyMappings>
                            <PropertyMapping property="Id" csProperty="GeneralInfo.u_Custom_Entity_id" />
                            <PropertyMapping property="FormName" csProperty="GeneralInfo.b_Custom_Entity_image" />
                            <PropertyMapping property="DateCreated" csProperty="GeneralInfo.dt_date_created" />
                            <PropertyMapping property="FormImage" csProperty="GeneralInfo.u_Custom_Entity_name"/>
                        </PropertyMappings>
                    </EntityMapping>
                </EntityMappings>
            </CommerceEntity>
            <!-- Custom Entity End—>

Do you see the problem? Well at first neither did I, and for that matter at second or third…. Look closely at this line

csAssembly=”Microsoft.CommerceServer.Runtime, Version=6.1.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″

Is should actually read:

csAssembly=”Microsoft.CommerceServer.Runtime, Version=6.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″

Once that simple typo was corrected, the whole process seemed to come to life.

E-Commerce With SharePoint 2010

I will be speaking at IT Camp Saturday in Ft Lauderdale on July 23rd.

This session will cover the basics of Commerce Server 2009 R2 and SharePoint 2010, with emphasis on Business User’s Content Management and Catalog Management.

I will be entertaining questions and presenting a demonstration of key features.

Here is the link to the session, and the link to registration.

Commerce Server 2009 R2 March CTP Released

The latest CTP has been added to the Microsoft Download Center

http://go.microsoft.com/fwlink/?LinkId=212469

Read the original post from Wayne Smith,  Commerce Server Product Manager here.

Tampa IT Camp Saturday

Just to let everyone know, I will be speaking at an Open Question and Answer Session at in Tampa on March 19th, 2011

http://itcampsaturday.com/tampa/sessions/?session=27

 

Here is the link to register

http://tampaitcampsaturday.eventbrite.com/

 

Looking forward to seeing you there.

Running out of debugging time

image

—————————
Microsoft Visual Studio
—————————
The web server process that was being debugged has been terminated by Internet Information Services (IIS).  This can be avoided by configuring Application Pool ping settings in IIS.  See help for further details.
—————————
OK   Help  
—————————

When debugging often time you’ll run into period of time where you will need more time than the application pool will allow when debugging.

A Simple fix is to change the timeouts on your Application Pool.

image

This give me all the time I need to debug those pesky pipelines.

Creating a Coupon/Promo Code for a specific product within a virtual catalog.

I’ve found that not always does the Discount Engine correctly pickup product id’s when using virtual catalogs in this fashion. So in order to work around this, we will use a Discount Specific Expression.

 

Frist step is to create the discount from within the Marketing Manager.  Start by navigating from the File –> New –> Discount

 

Click on Next from the wizard introduction screen.

Select the Customer that you would like to track the discount / promo through and click Next.

Select the appropriate Campaign for your discount and click Next

Provide a Discount Name and Basket Display, also make sure that your Start and End dates are correct.

Select Simple Discount Type and then click Next.

Select the product that you want to discount. Click Next.

 

Complete the remaining steps in the wizard, and reopen your discount.

 

image

From here, under the Receive (Award) section change the Product/Category dropdown to Discount Specific Expression.

Hit the select button, A window will open and this is where you will specify the product.

image

Now this is where the magic happens. Simply specify that the Product.ProductID must contain the product Id with out the catalog name.

 

You may now attach a coupon to the discount in order to activate the discount.

 

Steps to verify:

  1. Add the product to the cart.
  2. Apply the Coupon Code.
  3. Verify the discount has been applied.