Content Selection Framework - Ideas req'd - remote discounts?

This is Interesting: Free IT Magazines  
Home > Archive > Content Selection Framework > March 2005 > Ideas req'd - remote discounts?





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 Ideas req'd - remote discounts?
SusanH

2005-02-17, 5:51 pm

Commerce Server 2002, Feature Pack 1

Our CSR's have their own Win Form app for order placing and management
(connected to web site via lots of web services). What I can't seem to
duplicate is complete and correct order and item discounts.

More info on this scenario if requested, but my basic question is, has
anyone duplicated or implemented the functionality of the discount/order
pipeline?

Can I strip down the pipelines, or manually code using the CSF components,
or copy and somehow use the pipeline components? Can I somehow use the
MarketingDiscounts web services and manipulate from there?

Does anyone have any ideas as to how to "get" the discounts, in the context
of a User and a Basket, without sending the whole cart up to the web site and
running the whole basket pipeline (tried it, BAD performance hit)?

Thanks for any links, resources, suggestions, etc. Even a high-level "try
to think of it this way" suggestion would be great to get me started on
research.

Thanks in advance.
David Messner [MSFT]

2005-02-25, 2:50 am

I guess I have more questions than answers about the scenario.

The Basket.pcf pipeline is the component that contains all of the
discounting logic. As long as you set up the pipeline context and order
dictionaries correctly (which isn't necessarily trivial), you should be
able to execute the pipelines from any process.

I would think about implementing a Web service that accepts the orderform
and runs the pipeline on it to calculate the discounts (and whatever other
business logic you need). You mention bad performance for something like
this. I'm wondering why that is the case - the serializaiton of the order
and deserialization shouldn't be all that large. Did you identify where
the bottleneck arose?

The advantage of this approach is that you can use all the HttpModules
that are typically used in the runtime site in the Web service, making it
much easier to set up the context required to execute the pipelines.

I hope this helps - let me know if it's not what you're looking for.

-djm
--
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2005 Microsoft Corporation. All rights
reserved.

--------------------
Thread-Topic: Ideas req'd - remote discounts?
thread-index: AcUVKyVn0RMK2dTuQKui8sWTGeQzyQ==
X-WBNR-Posting-Host: 63.192.50.222
From: =?Utf-8?B?U3VzYW5I?= <SusanH@discussions.microsoft.com>
Subject: Ideas req'd - remote discounts?
Date: Thu, 17 Feb 2005 11:59:10 -0800
Lines: 23
Message-ID: <8752E6D6-8E86-421B-98D6-07B3076A2B51@microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.commerceserver.campaigns_csf
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: TK2MSFTNGXA01.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.commerceserver.campaigns_csf:533
X-Tomcat-NG: microsoft.public.commerceserver.campaigns_csf

Commerce Server 2002, Feature Pack 1

Our CSR's have their own Win Form app for order placing and management
(connected to web site via lots of web services). What I can't seem to
duplicate is complete and correct order and item discounts.

More info on this scenario if requested, but my basic question is, has
anyone duplicated or implemented the functionality of the discount/order
pipeline?

Can I strip down the pipelines, or manually code using the CSF components,
or copy and somehow use the pipeline components? Can I somehow use the
MarketingDiscounts web services and manipulate from there?

Does anyone have any ideas as to how to "get" the discounts, in the context
of a User and a Basket, without sending the whole cart up to the web site
and
running the whole basket pipeline (tried it, BAD performance hit)?

Thanks for any links, resources, suggestions, etc. Even a high-level "try
to think of it this way" suggestion would be great to get me started on
research.

Thanks in advance.

SusanH

2005-02-28, 5:53 pm

Thank you for your reply David.

I guess the simple answer to your question is, I don't know where the
bottleneck is in doing it your suggested way, which we tried in the past (but
I'll try it again).

I would guess that the problem is not so much in the actual transmission of
the data over the web service - it's more the fact that the Windows Forms
application that we have created for the CSR's are in no context of Commerce
Server whatsoever. Our "basket" is a local, stripped down version. When we
send that up to the web service, we have to parse out our object, and turn it
into an MSIB Cart, get the customer in Context, and get the Cart in context.
Then we can run the pipeline. Then we have to un-parse (?) the Cart back out
into our local basket object, and send that back.

I guess I was asking if there was a way just to send up a small group of
line items as an array, somehow run the CSF object manually on that, and get
the Item level and Order level Discounts, (not worrying about any Customer
specific expressions) and send those back down. I can't really find any
examples on MSDN that show how to use the CSF in code (or if what I'm looking
for is even possible).

Keep in mind also that I can code for Feature Pack 1, so if there are
suggestions such as using the Marketing web services, I'm all ears; although
I've looked thru them and haven't found much on my first glance that looks
like I can use for this purpose.

Thanks again for your input. I'll go on the assumption that the most
practical way is for a web service to run the full pipeline on a full Cart.
If you do come across any further suggestions, please point me in the right
direction.

THANKS
Sue


Ravi Shankar

2005-03-01, 2:49 am

Actually Susan, if you use the DictionaryXml Transforms object to serialize
the basket into the poschema.xml and back it'd be a single call (all you need
to watch out for is the fact that these transform functions don't handle
dates so well)..

So you use a stripped down version of the cart on your winform app,
transform it into poschema.xml and send it to the server where you'd use the
XML and the load the XML into a basket object.. run the pipeline.. convert
the basket back into XML and send it back... just like that

"SusanH" wrote:

> Thank you for your reply David.
>
> I guess the simple answer to your question is, I don't know where the
> bottleneck is in doing it your suggested way, which we tried in the past (but
> I'll try it again).
>
> I would guess that the problem is not so much in the actual transmission of
> the data over the web service - it's more the fact that the Windows Forms
> application that we have created for the CSR's are in no context of Commerce
> Server whatsoever. Our "basket" is a local, stripped down version. When we
> send that up to the web service, we have to parse out our object, and turn it
> into an MSIB Cart, get the customer in Context, and get the Cart in context.
> Then we can run the pipeline. Then we have to un-parse (?) the Cart back out
> into our local basket object, and send that back.
>
> I guess I was asking if there was a way just to send up a small group of
> line items as an array, somehow run the CSF object manually on that, and get
> the Item level and Order level Discounts, (not worrying about any Customer
> specific expressions) and send those back down. I can't really find any
> examples on MSDN that show how to use the CSF in code (or if what I'm looking
> for is even possible).
>
> Keep in mind also that I can code for Feature Pack 1, so if there are
> suggestions such as using the Marketing web services, I'm all ears; although
> I've looked thru them and haven't found much on my first glance that looks
> like I can use for this purpose.
>
> Thanks again for your input. I'll go on the assumption that the most
> practical way is for a web service to run the full pipeline on a full Cart.
> If you do come across any further suggestions, please point me in the right
> direction.
>
> THANKS
> Sue
>
>

SusanH

2005-03-03, 5:53 pm

Ravi:

This will be *extremely helpful* if I can get this working. I'm trying it
now. I am running into a problem, and I was wondering if you happened to
know where I can look to find the answer.

I've added references to my project for CS_DictXMLXfrms and MSSMLLib. I
have put in the following code into a sample page:

========
IDictionary dict = shoppingCart.OrderForm.Dictionary;
DictionaryXMLTransformsClass objXFrm = new DictionaryXMLTransformsClass();
string filename = Server.MapPath("poschema.xml");

MSXMLLib.IXMLDOMDocument doc = objXFrm.GetXMLFromFile(filename);
object o = objXFrm. GenerateXMLForDictionaryUsingSchema(dict
, doc);
========

When I get to either GetXMLFromFile, or GenerateXMLForDictionaryUsingSchema,
I run into a wierd exception:

=======
QueryInterface for interface
Microsoft.CommerceServer.Interop.IDictionaryXMLTransforms failed.
=======

I'm not finding any help on Google, nor do I see any one else in the
newsgroups who have posted about this. Do you have code samples, or see
what's wrong with mine, or know where to look?

Any help would be greatly appreciated. Thanks so much for the suggestion,
this may solve "all" of my problems if I can get this going.

SUE


"Ravi Shankar" wrote:

> Actually Susan, if you use the DictionaryXml Transforms object to serialize
> the basket into the poschema.xml and back it'd be a single call (all you need
> to watch out for is the fact that these transform functions don't handle
> dates so well)..


Ravi Shankar

2005-03-04, 2:47 am

Susan,

You'd need to use the "free threaded" set of objects

Dim oXMLTransform As DictionaryXMLTransformsFreeThreaded = New
DictionaryXMLTransformsFreeThreaded

Dim oOrderFormXML As MSXMLLib.IXMLDOMElement
Dim oXMLSchema As MSXMLLib.IXMLDOMDocument

oXMLSchema = oXMLTransforms.GetXMLFromFile(sFilePath)
oOrderFormXML =
oXMLTransforms. GenerateXMLForDictionaryUsingSchema(oOrd
erForm, oXMLSchema)

Where sFilePath is the complete specification to POSCHEMA.XML (like
C:\inetpub\wwwroot\<your sitename>\poschema.xml) and oOrderForm is the
OrderForm object in your basket.

Hope this helps.

"SusanH" wrote:

> Ravi:
>
> This will be *extremely helpful* if I can get this working. I'm trying it
> now. I am running into a problem, and I was wondering if you happened to
> know where I can look to find the answer.
>
> I've added references to my project for CS_DictXMLXfrms and MSSMLLib. I
> have put in the following code into a sample page:
>
> ========
> IDictionary dict = shoppingCart.OrderForm.Dictionary;
> DictionaryXMLTransformsClass objXFrm = new DictionaryXMLTransformsClass();
> string filename = Server.MapPath("poschema.xml");
>
> MSXMLLib.IXMLDOMDocument doc = objXFrm.GetXMLFromFile(filename);
> object o = objXFrm. GenerateXMLForDictionaryUsingSchema(dict
, doc);
> ========
>
> When I get to either GetXMLFromFile, or GenerateXMLForDictionaryUsingSchema,
> I run into a wierd exception:
>
> =======
> QueryInterface for interface
> Microsoft.CommerceServer.Interop.IDictionaryXMLTransforms failed.
> =======
>
> I'm not finding any help on Google, nor do I see any one else in the
> newsgroups who have posted about this. Do you have code samples, or see
> what's wrong with mine, or know where to look?
>
> Any help would be greatly appreciated. Thanks so much for the suggestion,
> this may solve "all" of my problems if I can get this going.
>
> SUE
>
>
> "Ravi Shankar" wrote:
>
>

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com