Commerce Server General - Problem with CS2007 'QueryCatalogInfo' Pipeline

This is Interesting: Free IT Magazines  
Home > Archive > Commerce Server General > August 2006 > Problem with CS2007 'QueryCatalogInfo' Pipeline





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Problem with CS2007 'QueryCatalogInfo' Pipeline
Steve

2006-08-11, 7:21 am

Hello I am developing an e-commerce website using MSCS 2007, and all is going
great until I reached the order system.

Adding items to baskets is simple and working fine however when I attempt to
run the 'basket' pipeline. An error is generated during the first stages of
the pipeline - "QueryCatalogInfo". When it attempts to read the value
"item.product_catalog" an error is displayed:

Exception Details: System.Exception: Component Execution failed for
component[0x0] hr: 0x80131500
ProgID: Commerce.QueryCatalogInfo
The catalog name is not valid. Catalog names may not be blank and may not
exceed 85 characters. Catalog names may not contain any of the following nine
reserved characters: .,"[]'()#.

I am sure there is a catalog available and I am also sure that this catalog
does not contain any .,"[]'()#.

Any1 knows where I can specify the catalog name of the catalog to be used
during the pipeline execution or does this pipeline executes on all product
catalogs defined in MSCS 2007??

Thanks for the help.
Steve

Ravi Shankar

2006-08-11, 7:21 am

Hello Steve,

The problem is not with your catalog (otherwise it'd not have displayed )
The problem seems to be pertaining to storage of catalog name with your
lineitem object... The QueryCatalogInfo uses the catalog name, category name
(if available), product name (SKU) and product variant id (if present) to get
the complete set of product details from the catalog system for use within
the pipelines. So I'd go and check the code being used to add the product to
the basket (there I'd also store the catalog name where I'm storing the SKU,
Qty, etc)

Hope this helps !
--
Ravi Shankar


"Steve" wrote:

> Hello I am developing an e-commerce website using MSCS 2007, and all is going
> great until I reached the order system.
>
> Adding items to baskets is simple and working fine however when I attempt to
> run the 'basket' pipeline. An error is generated during the first stages of
> the pipeline - "QueryCatalogInfo". When it attempts to read the value
> "item.product_catalog" an error is displayed:
>
> Exception Details: System.Exception: Component Execution failed for
> component[0x0] hr: 0x80131500
> ProgID: Commerce.QueryCatalogInfo
> The catalog name is not valid. Catalog names may not be blank and may not
> exceed 85 characters. Catalog names may not contain any of the following nine
> reserved characters: .,"[]'()#.
>
> I am sure there is a catalog available and I am also sure that this catalog
> does not contain any .,"[]'()#.
>
> Any1 knows where I can specify the catalog name of the catalog to be used
> during the pipeline execution or does this pipeline executes on all product
> catalogs defined in MSCS 2007??
>
> Thanks for the help.
> Steve
>

Steve

2006-08-11, 7:21 am

Hello Ravi,

Thanks for replying to my post.

I would like to know however, when u mentioned about specifying the catalog
name in lineitem did u mean when a lineitem is added to the order form, i.e
during the:

LineItem lineItem = new LineItem();

// Set the required LineItem properties
// productItem is a variable of type Product.

lineItem.Quantity = quantity;
lineItem.ProductCatalog = "catalogName";
lineItem.ProductId = productItem.ProductId;
lineItem.DisplayName = productItem.DisplayName;
lineItem.ProductCategory = category;

//add lineitem to orderform:
orderForm.LineItems.Add(lineItem, true);
basket.Save();

This is the exact code I am using and that is generating the error. As u can
see the catalog name is actually defined.

Can it be a pipeline problem ? although I am using the default "Basket"
pipeline and it hasnt been modified.

Thanks again.

"Ravi Shankar" wrote:
[vbcol=seagreen]
> Hello Steve,
>
> The problem is not with your catalog (otherwise it'd not have displayed )
> The problem seems to be pertaining to storage of catalog name with your
> lineitem object... The QueryCatalogInfo uses the catalog name, category name
> (if available), product name (SKU) and product variant id (if present) to get
> the complete set of product details from the catalog system for use within
> the pipelines. So I'd go and check the code being used to add the product to
> the basket (there I'd also store the catalog name where I'm storing the SKU,
> Qty, etc)
>
> Hope this helps !
> --
> Ravi Shankar
>
>
> "Steve" wrote:
>
Ravi Shankar

2006-08-11, 7:21 am

Hi Steve,

The problem line you'd need to examine would be

> lineItem.ProductCatalog = "catalogName";

You'd need to check if the "catalogName" is indded the name of the catalog
to which this product belongs. is "catalogName" actually your catalog name or
the name of the variable which hold the catalog name ?

--
Ravi Shankar


"Steve" wrote:
[vbcol=seagreen]
> Hello Ravi,
>
> Thanks for replying to my post.
>
> I would like to know however, when u mentioned about specifying the catalog
> name in lineitem did u mean when a lineitem is added to the order form, i.e
> during the:
>
> LineItem lineItem = new LineItem();
>
> // Set the required LineItem properties
> // productItem is a variable of type Product.
>
> lineItem.Quantity = quantity;
> lineItem.ProductCatalog = "catalogName";
> lineItem.ProductId = productItem.ProductId;
> lineItem.DisplayName = productItem.DisplayName;
> lineItem.ProductCategory = category;
>
> //add lineitem to orderform:
> orderForm.LineItems.Add(lineItem, true);
> basket.Save();
>
> This is the exact code I am using and that is generating the error. As u can
> see the catalog name is actually defined.
>
> Can it be a pipeline problem ? although I am using the default "Basket"
> pipeline and it hasnt been modified.
>
> Thanks again.
>
> "Ravi Shankar" wrote:
>
Jeff Lynch

2006-08-11, 1:30 pm

I may be all wet on this, but from your code it looks like you may have
forgotten to run the pipeline before saving the basket.

I use this code to update by basket:

public void UpdateBasket(string pipelinename)
{
// Run the pipeline
_Basket. RunPipeline(GetBasketPipelineInfo(pipeli
nename));
// Save the Basket
_Basket.Save();
// Dispose of the PipelineInfo object
this.GetBasketPipelineInfo(pipelinename).Dispose();
}

--
Jeff Lynch
MVP Windows Server System - Commerce Server
http://codebetter.com/blogs/jeff.lynch


"Steve" <Steve@discussions.microsoft.com> wrote in message
news:640E9939-BAA2-4D8C-8D34-6DA006C4632C@microsoft.com...[vbcol=seagreen]
> Hello Ravi,
>
> Thanks for replying to my post.
>
> I would like to know however, when u mentioned about specifying the
> catalog
> name in lineitem did u mean when a lineitem is added to the order form,
> i.e
> during the:
>
> LineItem lineItem = new LineItem();
>
> // Set the required LineItem properties
> // productItem is a variable of type Product.
>
> lineItem.Quantity = quantity;
> lineItem.ProductCatalog = "catalogName";
> lineItem.ProductId = productItem.ProductId;
> lineItem.DisplayName = productItem.DisplayName;
> lineItem.ProductCategory = category;
>
> //add lineitem to orderform:
> orderForm.LineItems.Add(lineItem, true);
> basket.Save();
>
> This is the exact code I am using and that is generating the error. As u
> can
> see the catalog name is actually defined.
>
> Can it be a pipeline problem ? although I am using the default "Basket"
> pipeline and it hasnt been modified.
>
> Thanks again.
>
> "Ravi Shankar" wrote:
>


Steve

2006-08-12, 7:16 pm

Hello Mr. Lynch,

I saw your article about adding items to basket on codebetter.com. Also,
thank you for your suggestion about running the pipeline before saving the
basket. Yes it's true I forgot to do that.

However I am trying to follow the MS way used in the MSCS 2006 starter site
and they have the basket saved before the running pipeline.

So, I will try what you suggested.

One last thing. In your code you used:
_Basket. RunPipeline(GetBasketPipelineInfo(pipeli
nename)); in the
UpdateBasket void.

'GetBasketPipelineInfo' is a custom function that returns a pipelineinfo
(variable) for a specified pipeline name and of specific type as in:

PipelineInfo pipeline = new PipelineInfo(pipelineName,
OrderPipelineType.Basket)
return pipeline;

am i right ?
Thanks

"Jeff Lynch" wrote:

> I may be all wet on this, but from your code it looks like you may have
> forgotten to run the pipeline before saving the basket.
>
> I use this code to update by basket:
>
> public void UpdateBasket(string pipelinename)
> {
> // Run the pipeline
> _Basket. RunPipeline(GetBasketPipelineInfo(pipeli
nename));
> // Save the Basket
> _Basket.Save();
> // Dispose of the PipelineInfo object
> this.GetBasketPipelineInfo(pipelinename).Dispose();
> }
>
> --
> Jeff Lynch
> MVP Windows Server System - Commerce Server
> http://codebetter.com/blogs/jeff.lynch
>
>
> "Steve" <Steve@discussions.microsoft.com> wrote in message
> news:640E9939-BAA2-4D8C-8D34-6DA006C4632C@microsoft.com...
>
>
>

Steve

2006-08-12, 7:16 pm

Hello Ravi,

Yes, I am sure I am having the catalog name right. I changed the catalog
name in here for sake of the example: lineItem.ProductCatalog = "catalogName";

I can't display the real catalog name here for business reasons.

I think however, that Jeff is right about his post.

"Ravi Shankar" wrote:
[vbcol=seagreen]
> Hi Steve,
>
> The problem line you'd need to examine would be
>
> You'd need to check if the "catalogName" is indded the name of the catalog
> to which this product belongs. is "catalogName" actually your catalog name or
> the name of the variable which hold the catalog name ?
>
> --
> Ravi Shankar
>
>
> "Steve" wrote:
>
Steve

2006-08-12, 7:16 pm

Unfortunatelly Jeff,

The problem persists, I am sure I got the catalog name right, I mean I can
browse the catalog get a product and display it's details (all these
functions require that I specify a catalog name, and they are all working).

But I can't get the pipeline to run without displaying a:
Exception Details: System.Exception: Component Execution failed for
component[0x0] hr: 0x80131500
ProgID: Commerce.QueryCatalogInfo
The catalog name is not valid. Catalog names may not be blank and may not
exceed 85 characters. Catalog names may not contain any of the following nine
reserved characters: .,"[]'()#.

Any idea what could be causing this problem ?

Thanks
Steve

"Jeff Lynch" wrote:

> I may be all wet on this, but from your code it looks like you may have
> forgotten to run the pipeline before saving the basket.
>
> I use this code to update by basket:
>
> public void UpdateBasket(string pipelinename)
> {
> // Run the pipeline
> _Basket. RunPipeline(GetBasketPipelineInfo(pipeli
nename));
> // Save the Basket
> _Basket.Save();
> // Dispose of the PipelineInfo object
> this.GetBasketPipelineInfo(pipelinename).Dispose();
> }
>
> --
> Jeff Lynch
> MVP Windows Server System - Commerce Server
> http://codebetter.com/blogs/jeff.lynch
>
>
> "Steve" <Steve@discussions.microsoft.com> wrote in message
> news:640E9939-BAA2-4D8C-8D34-6DA006C4632C@microsoft.com...
>
>
>

Jeff Lynch

2006-08-12, 7:16 pm

Steve,

I think you need to look at the code which returns the value your are
putting into the "catalogName" variable and passing to your code which sets
this value in the LineItem.ProductCatalog property. Set a break point on
your lineItem.ProductCatalog = "catalogName"; code and see what is really
being passed to this.

Look at the the part of your code which returns the
Microsoft.CommerceServer.Catalog.Product object. I use the code shown below
which takes the "CatalogName" and "ProductId" strings and returns the
Product object. Once you have the Product object you can return all it's
properties such as the CatalogItem.ProductCatalog.Name property which is
what you want to pass the LineItem.ProductCatalog property.

public Product GetProduct(string CatalogName, string ProductId)
{
// Return a Product object using the CatalogName and ProductId
return
CommerceContext.Current.CatalogSystem.GetCatalog(CatalogName).GetProduct(ProductId);
}

If you still need help, ping me at jtlynch@houston.rr.com

--
Jeff Lynch
MVP Windows Server System - Commerce Server
http://codebetter.com/blogs/jeff.lynch


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com