HomeHome Product Discus... Product Discus...SmithCartSmithCartCalling a web service using the carts OnCheckoutComplete eventCalling a web service using the carts OnCheckoutComplete event
Previous
 
Next
New Post
8/5/2010 4:05 PM
 

Question: We need a way to send the order information (name/email/order number) to a web service which will handle sending out a license key for the digital product. What is the best way to handle this? I know the cart can call a Store Procedure, however, there is little documentation on how to use this and if and what variables can be passed to the Stored Procedure.

Answer:
Enable OnCheckout Complete Event – Allows you to call a custom SQL Server stored procedure that you program. The event that triggers the stored procedure being executed is a successful checkout in the cart.


Note: When naming your stored procedure you will need to append the following:


DatabaseOwner + ObjectQualifier + ModuleQualifier in front of your stored procedure.


DatabaseOwner is usually “dbo”
ObjectQualifier – Is assigned when you installed DNN (defaults to _dnn)
ModuleQualifier is “Smith”


For example, a stored procedure titled “TransferOrder” should be named as follows:


“dbo.dnn_Smith_ TransferOrder”


I googled “sql server stored procedure call a web service” and there are a lot of articles that explain how to do this
Here is a good link that describes how to call a web service from a stored procedure:


http://www.databasejournal.com/features/mssql/article.php/3821271/Calling-a-Web-Service-from-within-SQL-Server.htm


Also here is a forum post on it http://www.smith-consulting.com/forums/forumid/1/postid/2025/scope/posts.aspx#2025


Scott Kelly
Project Manager
DotNetNuke Consulting, DotNetNuke Store and DNN Ecommerce
 
New Post
2/14/2011 2:57 PM
 

We are not using a default qualfier so a normal SP name would be "dbo.MyStoreProcedure"

So in the settings box I have entered "dbo.Smith_MyStoredProcedure" but get the error:

'dbo' is not a valid database. (may not be the exact wording, but something close to that.)

I have tried entering also "MydatebaseName.dbo.Smith_MyStoredProcedure" too and get:

Could not find server 'dbo' in sys.servers. Verify that the correct server name was specified. If necessary, execute the stored procedure sp_addlinkedserver to add the server to sys.servers.

I have created both stored procedures "dbo.MyStoreProcedure" and "dbo.Smith_MyStoredProcedure" but get the same error messages either way. These errors occur after the order is processed and otherwise the ordering process is working OK.
The module I'm testing this on is still in trial mode if that matters.

 
New Post
2/15/2011 5:36 AM
 

You've got it exactly backwards.

THe normal name needs to be Smith_MyStoreProcedure

... in the cart, put MyStoreProcedure as the procedure to call.

The .dbo (Database Owner) is understood, so don't include it.

I struggled with this one initially, until I realized that it was putting the dbo and Smith_ in front of the name of the SP that I put in the cart settings. I renamed my SP to Smith_MyStoredProc, and put MyStoredProc in the settings, and everything is ducky.

 
New Post
2/15/2011 7:56 AM
 

gbaughma wrote:

The normal name needs to be Smith_MyStoreProcedure

... in the cart, put MyStoreProcedure as the procedure to call.


The .dbo (Database Owner) is understood, so don't include it.


I struggled with this one initially, until I realized that it was putting the dbo and Smith_ in front of the name of the SP that I put in the cart settings. I renamed my SP to Smith_MyStoredProc, and put MyStoredProc in the settings, and everything is ducky.

You've got it exactly backwards.

That was it and now it's working. Thanks!

 
New Post
2/15/2011 11:49 AM
 

Glad that I could help. :)

 
Previous
 
Next
HomeHome Product Discus... Product Discus...SmithCartSmithCartCalling a web service using the carts OnCheckoutComplete eventCalling a web service using the carts OnCheckoutComplete event