|
Home > Archive > Commerce Server General > October 2005 > Completed Custom 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 |
Completed Custom Pipeline
|
|
| cgruber 2005-09-07, 8:51 pm |
| Does anyone have a "fleshed out" example of Pipeline Component in C#.
The example in MSDN doesn't really show much. I am interested in the
parameters coming in and the return values. They are mostly just
objects. What should they be really? What should they be cast to?
What type of object should I really return?
I am specifically designing a new pipeline to do custom shipping using
UPS's Rate Checking online service. A completed pipeline component
would help me out tremendoesly to use as a better template than what
Microsoft provides on their MSDN site.
As of now I am modifying the sample MinMaxShipCSharp.cs file found
at:
C:\program files\Microsoft Commerce Server 2002\SDK\Samples\Order
Processing\MinMaxShip\CSharp\MinMaxShipC
Sharp.cs
It appears that many of the fields I will need to send to UPS are in
the dictionary, but it looks like Weight may not be. Any ideas on
how to get this in there easily?
Thanks!
Chris
| |
| Ravi Shankar 2005-09-08, 7:52 am |
| Hi Chris,
The pipeline Components reference the COM+ Interfaces and not the .Net
objects. So refer to the COM/Interop section of the programmers guide and
reference the objects accordingly.
The "weight" property comes from the catalog where is a product level
property and should be defined as a "numeric" or "decimal" type. This is
loaded by the product properties component in the pipeline and is accessible
as lineitem._product_weight or something like that.
--
Ravi Shankar
"cgruber" wrote:
> Does anyone have a "fleshed out" example of Pipeline Component in C#.
> The example in MSDN doesn't really show much. I am interested in the
> parameters coming in and the return values. They are mostly just
> objects. What should they be really? What should they be cast to?
> What type of object should I really return?
>
> I am specifically designing a new pipeline to do custom shipping using
> UPS's Rate Checking online service. A completed pipeline component
> would help me out tremendoesly to use as a better template than what
> Microsoft provides on their MSDN site.
>
> As of now I am modifying the sample MinMaxShipCSharp.cs file found
> at:
>
> C:\program files\Microsoft Commerce Server 2002\SDK\Samples\Order
> Processing\MinMaxShip\CSharp\MinMaxShipC
Sharp.cs
>
> It appears that many of the fields I will need to send to UPS are in
> the dictionary, but it looks like Weight may not be. Any ideas on
> how to get this in there easily?
>
> Thanks!
> Chris
>
>
| |
| Vinod Kumar[MSFT] 2005-09-13, 8:48 pm |
| You'll need to extend you catalog schema to include the weight field. This filed will contain the weight for each product. QCI component populates all the product properties from the catalog system into the items
dictioanry. This you can access easily in your pipeline component.
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2002 Microsoft Corporation. All rights
reserved.
--------------------
NNTP-Posting-Date: Wed, 07 Sep 2005 19:43:09 -0500
Subject: Completed Custom Pipeline
From: cgruber@bgnet.bgsu-dot-edu.no-spam.invalid (cgruber)
Newsgroups: microsoft.public.commerceserver.general
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit
User-Agent: newsSync (Commerce Server) 6925
Message-ID: <JNOdneYo_u2AFILeRVn_vQ@giganews.com>
Date: Wed, 07 Sep 2005 19:43:09 -0500
Lines: 1
X-Trace: sv3-hQD12CJgv30DfCaj4dzM7bYGltlBhja8+p8/ AeGz8dSWY6UJ3C+jRNq+ApNPZADCmPjWyTuvrkMV
7H2!uyNdIwtH1YNUmIsMkJbcF/x5tu9e+kI5vIVggnyw3c5UfTKlfUVTNffcml+0
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.32
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!border2.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!
nntp.giganews.com!local01.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail
Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.commerceserver.general:16754
X-Tomcat-NG: microsoft.public.commerceserver.general
Does anyone have a "fleshed out" example of Pipeline Component in C#.
The example in MSDN doesn't really show much. I am interested in the
parameters coming in and the return values. They are mostly just
objects. What should they be really? What should they be cast to?
What type of object should I really return?
I am specifically designing a new pipeline to do custom shipping using
UPS's Rate Checking online service. A completed pipeline component
would help me out tremendoesly to use as a better template than what
Microsoft provides on their MSDN site.
As of now I am modifying the sample MinMaxShipCSharp.cs file found
at:
C:\program files\Microsoft Commerce Server 2002\SDK\Samples\Order
Processing\MinMaxShip\CSharp\MinMaxShipC
Sharp.cs
It appears that many of the fields I will need to send to UPS are in
the dictionary, but it looks like Weight may not be. Any ideas on
how to get this in there easily?
Thanks!
Chris
| |
| cgruber 2005-09-14, 8:49 pm |
| Thanks for your help guys. Unfortunatly I can't even get that far.
I'm using the MinMaxCSharp component in the SDK and modifying it to
add up shipping weight instead of cost.
However this line is giving me trouble
// retrieve the shipments that must be processed
ShipmentsToProcess =
(ISimpleList)Context[ShipmentsToProcessKey];
I got it to throw this exception to the log:
> PIPELINE:-- component [0x4] returned hr: 0x80131500, IErrorLevel=4
in 187 milliseconds
> Error Description: Component Execution failed for component[0x4]
hr: 0x80131500
> ProgID: Commerce.UPSShipping
> Specified cast is not valid.
> PIPELINE:-- 2005/09/14 11:12:43.0968 Pipeline Execution completed
returning hr: 0x80131500
> i: 0x5
> hrLoop: 0x80131500
> *plErrorLevel: 1000
>
> Sink stopped at 2005/09/14 11:12:43.0968
This is the source shipped with Commerce Server in the SDK, I would
think that it would compile and run at least...
If I can't cast it to an ISimpleList, what are my other options?
Thanks,
Chris
| |
| Ravi Shankar 2005-09-15, 5:59 pm |
| Hi cgruber,
1. the key is "ShipmentToProcess" and not "ShipmentToProcessKey".
2. This is an INTEGER (and part of the context - Correct)
3. This is an index into the shipments list which is a list of lists 
4. shipments is available on OrderForm.
Actually if you go through the CS Help File you'd be able to identify all
these keys & their heirarchy.
--
Ravi Shankar
"cgruber" wrote:
> Thanks for your help guys. Unfortunatly I can't even get that far.
>
> I'm using the MinMaxCSharp component in the SDK and modifying it to
> add up shipping weight instead of cost.
>
> However this line is giving me trouble
>
> // retrieve the shipments that must be processed
> ShipmentsToProcess =
> (ISimpleList)Context[ShipmentsToProcessKey];
>
> I got it to throw this exception to the log:
>
> in 187 milliseconds
> hr: 0x80131500
> returning hr: 0x80131500
>
> This is the source shipped with Commerce Server in the SDK, I would
> think that it would compile and run at least...
>
> If I can't cast it to an ISimpleList, what are my other options?
>
> Thanks,
> Chris
>
>
| |
| cgruber 2005-09-15, 8:52 pm |
| Thanks Ravi,
I'm getting sidetracked with another project right now, I should be
back to this in less than 2 weeks. I'll let you know how it goes.
Thanks again,
Chris
| |
| cgruber 2005-09-19, 6:00 pm |
| Looking back at this real quick, I believe I have had the correct key
in here:
private const String ShipmentsToProcessKey =
"shipments_to_process";
...
ShipmentsToProcess = (ISimpleList)
Context[ShipmentsToProcessKey];
If this still doesn't look right, let me know.
Chris
| |
| Vinayak Tadas[MSFT] 2005-09-23, 2:48 am |
| One thing you can do
1. Open the property definition "weight" and check the Assign to all
Product Types checkbox. This way the property will get added to all
existing product definitions and newly created definitions. If the property
does not exist then create a property named "weight" of type decimal and
check the Assign to all Product Types checkbox
Thanks
Vinayak Tadas
Microsoft
http://blogs.msdn.com/vinayakt
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2002 Microsoft Corporation. All rights
reserved.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Get Secure! For more info visit http://www.microsoft.com/security. Please
reply to the newsgroups only
--------------------
X-Tomcat-ID: 20928103
References: <JNOdneYo_u2AFILeRVn_vQ@giganews.com>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_0001_B2CF8AF0"
Content-Transfer-Encoding: 7bit
From: vkumar@online.microsoft.com (Vinod Kumar[MSFT])
Organization: Microsoft
Date: Wed, 14 Sep 2005 01:13:22 GMT
Subject: RE: Completed Custom Pipeline
X-Tomcat-NG: microsoft.public.commerceserver.general
Message-ID: <BShLBmMuFHA.932@TK2MSFTNGXA01.phx.gbl>
Newsgroups: microsoft.public.commerceserver.general
Lines: 152
Path: TK2MSFTNGXA01.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.commerceserver.general:3441
NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
You'll need to extend you catalog schema to include the weight field. This
filed will contain the weight for each product. QCI component populates all
the product properties from the catalog system into the items dictioanry.
This you can access easily in your pipeline component.
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2002 Microsoft Corporation. All rights
reserved.
--------------------
NNTP-Posting-Date: Wed, 07 Sep 2005 19:43:09 -0500
Subject: Completed Custom Pipeline
From: cgruber@bgnet.bgsu-dot-edu.no-spam.invalid (cgruber)
Newsgroups: microsoft.public.commerceserver.general
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit
User-Agent: newsSync (Commerce Server) 6925
Message-ID: <JNOdneYo_u2AFILeRVn_vQ@giganews.com>
Date: Wed, 07 Sep 2005 19:43:09 -0500
Lines: 1
X-Trace:
sv3-hQD12CJgv30DfCaj4dzM7bYGltlBhja8+p8/AeGz8dSWY6UJ3C+jRNq+ApNPZADCmPjWyTuv
rkMV7H2!uyNdIwtH1YNUmIsMkJbcF/x5tu9e+kI5vIVggnyw3c5UfTKlfUVTNffcml+0
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your
complaint properly
X-Postfilter: 1.3.32
Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.
sul.t-online.de!t-online.de!border2.nntp.dca.giganews.com!border1.nntp.dca.g
iganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!news.giganews.co
m.POSTED!not-for-mail
Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.commerceserver.general:16754
X-Tomcat-NG: microsoft.public.commerceserver.general
Does anyone have a "fleshed out" example of Pipeline Component in C#.
The example in MSDN doesn't really show much. I am interested in the
parameters coming in and the return values. They are mostly just
objects. What should they be really? What should they be cast to?
What type of object should I really return?
I am specifically designing a new pipeline to do custom shipping using
UPS's Rate Checking online service. A completed pipeline component
would help me out tremendoesly to use as a better template than what
Microsoft provides on their MSDN site.
As of now I am modifying the sample MinMaxShipCSharp.cs file found
at:
C:\program files\Microsoft Commerce Server 2002\SDK\Samples\Order
Processing\MinMaxShip\CSharp\MinMaxShipC
Sharp.cs
It appears that many of the fields I will need to send to UPS are in
the dictionary, but it looks like Weight may not be. Any ideas on
how to get this in there easily?
Thanks!
Chris
| |
| cgruber 2005-09-26, 8:48 pm |
| OK. I got this worked out without creating a custom pipeline
component.
I followed MS's steps for implementing the MinMaxShip.
After I got it working with the site, I went in and changed it to work
with what we were trying to do: Calculate shipping based on what
UPS's XML services calculates it to be (based upon weight, origin,
destination, shipping service, etc)
I changed the MinMax.asp file to take in UPS Shipping Service code
instead of the 'Floor' field and also changed the 'Percentage' field
to be what percentage of the shipping to charge as the handling fee.
Everything is working great with it. If you are trying to do
something similar, email me and I will send you the code I have and
save you some time. cgruber50@aol.com
Thanks everyone for all your help with this!
| |
| Colin Bowern 2005-09-27, 5:53 pm |
| There is a similar component posted on the GotDotNet workspace. Feel free
to contribute the code there in terms of making it available.
http://www.gotdotnet.com/Workspaces...a0-b7f284a8c113
Cheers,
Colin
> OK. I got this worked out without creating a custom pipeline
> component.
>
> I followed MS's steps for implementing the MinMaxShip.
>
> After I got it working with the site, I went in and changed it to work
> with what we were trying to do: Calculate shipping based on what
> UPS's XML services calculates it to be (based upon weight, origin,
> destination, shipping service, etc)
>
> I changed the MinMax.asp file to take in UPS Shipping Service code
> instead of the 'Floor' field and also changed the 'Percentage' field
> to be what percentage of the shipping to charge as the handling fee.
>
> Everything is working great with it. If you are trying to do
> something similar, email me and I will send you the code I have and
> save you some time. cgruber50@aol.com
>
> Thanks everyone for all your help with this!
>
| |
| cgruber 2005-10-04, 8:49 pm |
| Thanks Colin!
I uploaded what I had... careful, there isnt much error checking or
data integrity checks, but it will "Git R' Done"
|
|
|
|
|