Module 1: E-COMMERCE TECHNICAL OVERVIEW
Module 2: DEVELOPMENT ENVIRONMENT
Module 3: BRANDING THE E-COMMERCE SITE
Module 4: ECOMMERCE WEB PARTS
Module 5: SEARCH CONFIGURATION AND CUSTOMIZATION
Module 6: COMMERCE RUNTIME SERVICES
Module 7: TESTING, DEPLOYMENT AND VERSIONING OF ECOMMERCE SITE
Lesson 2: How to: Add a New AJAX Service to the Storefront
How to: Add a New AJAX Service to the Storefront
How to: Add a New AJAX Service to the Storefront : Creation of a new AJAX Service requires the following general steps:
- Create an interface for your service. The interface should have the ServiceContract attribute declaration. Define the methods that your service will expose and mark them with the OperationContract attribute. This is your service API.
- Create a controller. The controller contains implementation details for creating, updating, reading, deleting data to/from the CRT or other data sources. The controller is called by the service method and returns a front-end object or collection instance. Controllers reside in the SharePoint.Web.Services project’s ObjectModel subdirectory.
- Create a mapper (optional). A mapper converts an object from its back-end representation to a front-end representation of the object. They are used in controllers. It is optional to create a new mapper as you may be able to utilize one of the existing mapper classes. Mappers reside in the SharePoint.Web.Services project’s ObjectModel subdirectory.
- Create a response object (optional). A response object encapsulates the data your service is returning to the page. It is utilized in the service method to wrap the data returned from the controller into a response to be consumed by the page. It is optional to create a new response object as you may be able to utilize one of the existing response classes. Response objects reside in the SharePoint.Web.Services project’s ViewModel subdirectory.
To understand how to create an AJAX service to connect to Storefront.
- Download and install the Dynamics AX 2012 for Retail SDK
- Open the solution file e.g. C:\Users\<username>\My Documents\Channels\SharePoint\Solution\RetailStoreFront.sln