Saturday, April 20, 2013

SharePoint2013: Shopping Cart Provider hosted app prototype

Scenario: How to develop a shopping cart provider hosted app prototype using managed CSOM

Solution: Create a Provider Hosted App using "App for SharePoint2013" template

Add the following code in the remote web (web application) projects home\landing page (.aspx) within the "body\form" section.

Add the following code in remote webs home\landing page code behind.

Call the "RetrieveWithCSOM" function in Page_Load, passing it the accessToken.

The sample shopping cart prototype app UI looks like below
 
Note: If your Remote webapplication is located outside the firewall , you may see 401 error while remote webapplication is trying to talk back to SharePoint, in this scenario use Cross-domain library to talk back to SharePoint.

1 comment:

  1. Hi, I find reading this article a joy. It is extremely helpful and interesting and very much looking forward to reading more of your work.. 성인용품창업

    ReplyDelete