|
Home > Archive > Commerce Server General > September 2006 > Problem with 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 pipeline
|
|
| Thomas 2006-09-16, 7:28 pm |
| I'm having a problem pushing an order through a pipeline that interacts with
Cybersource.
When I push a MS.CS.Runtime.OrderForm (via OrderGroup) into the pipeline it
barfs, however, if I use MS.CS.Interop.OrderForm ala the Cybersource example, it
works. The error is something along the lines of the object (the OrderForm) not
implementing a Runtime.IDictionary interface. Using reflector it appears that
the Runtime.OrderForm class indeed does not implement the Runtime.IDictionary
interface. Am I correct in assuming that if I want to use the Cybersource
component with my Checkout pipeline that I have to manually (in code) covert my
Runtime.Orderform into a Interop.Orderform?
Thomas
| |
| Joseph Johnson 2006-09-16, 7:28 pm |
| Can you provide the code snippet you are using for invoking the
pipeline? I'm having trouble understanding why you're invoking the
pipeline on an OrderForm instead of a Basket or a PurchaseOrder.
Additionally, if I might inquire as to what sort of application you're
invoking this pipeline from? The runtime libraries are typically meant
to be utilized in an ASP application, where the pipeline configuration
is done in the web.config. You can't just interchangeably use the
runtime and interop code, as it doesn't work quite the same. For
instance, instantiating something from the runtime where you don't have
a valid context *will* cause these interop methods to "barf".
Thomas wrote:
> I'm having a problem pushing an order through a pipeline that interacts with
> Cybersource.
>
> When I push a MS.CS.Runtime.OrderForm (via OrderGroup) into the pipeline it
> barfs, however, if I use MS.CS.Interop.OrderForm ala the Cybersource example, it
> works. The error is something along the lines of the object (the OrderForm) not
> implementing a Runtime.IDictionary interface. Using reflector it appears that
> the Runtime.OrderForm class indeed does not implement the Runtime.IDictionary
> interface. Am I correct in assuming that if I want to use the Cybersource
> component with my Checkout pipeline that I have to manually (in code) covert my
> Runtime.Orderform into a Interop.Orderform?
>
>
> Thomas
| |
| Thomas 2006-09-16, 7:28 pm |
| Is it not the case that a Basket contains an OrderForm collection? I believe the
reason I passed an OrderForm directly was that passing the Basket caused a
casting failure in that it was looking for something that implemented
Runtime.IDictionary.
However, I believe that either passing Runtime.OrderForm or
RunTime.Orders.Basket will cause the checkout pipeline with the Cybersource
component to fail.
This is meant for a standard checkout ASP.NET application (CS 2007). So, in the
checkout code, I'm passing the single OrderForm that would be on the Basket to
the Checkout pipeline and then executing the pipeline. It seems strange that I
can't pass the .NET classes into the pipeline and have it work. How else do you
invoke the pipeline (and where is it documented).
<rant>
What would be incredibly useful is if the documentation provide a developer
level workflow as to how to utilize the objects. Beyond the StarterSite, I'd
like to see something like:
Create a basket object.
Add an OrderForm to the basket.
Save the basket
Pass the basket to pipeline A, B, C etc..
Getting my head around *why* I need or not need to do something with the CS API
has been incredibly difficult to find.
</rant>
Thomas
"Joseph Johnson" <joe8t88@hotmail.com> wrote in message
news:1158346167.202103.58750@p79g2000cwp.googlegroups.com...
> Can you provide the code snippet you are using for invoking the
> pipeline? I'm having trouble understanding why you're invoking the
> pipeline on an OrderForm instead of a Basket or a PurchaseOrder.
>
> Additionally, if I might inquire as to what sort of application you're
> invoking this pipeline from? The runtime libraries are typically meant
> to be utilized in an ASP application, where the pipeline configuration
> is done in the web.config. You can't just interchangeably use the
> runtime and interop code, as it doesn't work quite the same. For
> instance, instantiating something from the runtime where you don't have
> a valid context *will* cause these interop methods to "barf".
>
>
>
> Thomas wrote:
>
| |
| Joseph Johnson 2006-09-16, 7:28 pm |
| Thomas,
I'm just going to write some sample code off the top of my head and
hopefully this will make sense:
//Retrieve the basket for the current user signed in
Basket bas = CommerceContext.Current.OrderContext.GetBasket(new
guid(CommerceContext.Current.UserID));
//Add an OrderForm object to the basket if none exists
if(bas.OrderForms.count == 0)
bas.OrderForms.Add(new OrderForm("default");
//Run the basket.pcf on the basket currently in memory.
bas.RunPipeline("basket")
Note that the RunPipeline method will effectively "serialize" your
orderforms into a data dictionary which the pipelines can operate on.
The pipeline is run for each orderform object in your
basket/purchaseorder.
Here's the closest thing I can give you to the "workflow" you're
looking for, I suggest you read this thoroughly before coding anything:
http://msdn.microsoft.com/library/d...13d50809b6d.asp
Also, I should note that the CyberSource pipeline component is
developed to run for CS2002, and I know that CS2007 introduces a
"payment collection" object which the CyberSource component *probably*
wont know how to work with at this point.
Joe
Thomas wrote:[vbcol=seagreen]
> Is it not the case that a Basket contains an OrderForm collection? I believe the
> reason I passed an OrderForm directly was that passing the Basket caused a
> casting failure in that it was looking for something that implemented
> Runtime.IDictionary.
>
> However, I believe that either passing Runtime.OrderForm or
> RunTime.Orders.Basket will cause the checkout pipeline with the Cybersource
> component to fail.
>
> This is meant for a standard checkout ASP.NET application (CS 2007). So, in the
> checkout code, I'm passing the single OrderForm that would be on the Basket to
> the Checkout pipeline and then executing the pipeline. It seems strange that I
> can't pass the .NET classes into the pipeline and have it work. How else do you
> invoke the pipeline (and where is it documented).
>
>
> <rant>
> What would be incredibly useful is if the documentation provide a developer
> level workflow as to how to utilize the objects. Beyond the StarterSite, I'd
> like to see something like:
>
> Create a basket object.
> Add an OrderForm to the basket.
> Save the basket
> Pass the basket to pipeline A, B, C etc..
>
> Getting my head around *why* I need or not need to do something with the CS API
> has been incredibly difficult to find.
>
> </rant>
>
> Thomas
>
>
> "Joseph Johnson" <joe8t88@hotmail.com> wrote in message
> news:1158346167.202103.58750@p79g2000cwp.googlegroups.com...
| |
| Thomas 2006-09-16, 7:28 pm |
| Thanks Joseph. That helped a bit. Perhaps the thing that has helped the most is
figuring out how to unit test CS stuff. However, now I'm hitting a new level of
hell in debugging the existing pipeline components via a unit test and figure
out what the hell is going on. I have enabled logging on the pipeline but for
some reason when I run a basket pipeline I get an "Object reference not set to
an instance of an object."
I have updated the config file for the VSTS tests to use full paths e.g.
something like (elispses added for brevity):
<pipelines loggingEnabled="true"
logPath="C:\...\log">
<pipeline
name="basket"
path="C:\..\basket.pcf"
transacted="false"
type="OrderPipeline"
loggingEnabled="true"/>
But it does not appear to write to the log.
Thomas
"Joseph Johnson" <joe8t88@hotmail.com> wrote in message
news:1158349874.057336.97750@d34g2000cwd.googlegroups.com...
> Thomas,
>
> I'm just going to write some sample code off the top of my head and
> hopefully this will make sense:
>
> //Retrieve the basket for the current user signed in
> Basket bas = CommerceContext.Current.OrderContext.GetBasket(new
> guid(CommerceContext.Current.UserID));
>
> //Add an OrderForm object to the basket if none exists
> if(bas.OrderForms.count == 0)
> bas.OrderForms.Add(new OrderForm("default");
>
> //Run the basket.pcf on the basket currently in memory.
> bas.RunPipeline("basket")
>
> Note that the RunPipeline method will effectively "serialize" your
> orderforms into a data dictionary which the pipelines can operate on.
> The pipeline is run for each orderform object in your
> basket/purchaseorder.
>
> Here's the closest thing I can give you to the "workflow" you're
> looking for, I suggest you read this thoroughly before coding anything:
>
> http://msdn.microsoft.com/library/d...13d50809b6d.asp
>
> Also, I should note that the CyberSource pipeline component is
> developed to run for CS2002, and I know that CS2007 introduces a
> "payment collection" object which the CyberSource component *probably*
> wont know how to work with at this point.
>
> Joe
>
> Thomas wrote:
>
|
|
|
|
|