All the code is contained in the folder '_samples'. There are 3 sub folders in that folder.
This folder contains the minified version of Sdk.soap.min.js, jquery_1.9.1.min.js and folders for actions, entities and messages.
- vsdoc:This folder contains all the same files and folders as the 'min' folder but they are not min-ified. Libraries in this folder contains comments etc. for the developer. Script files from this folder will be used in sampleCode scripts to provide IntelliSense.
Project TemplateI think development teams should use project templates if they are doing similar work all the time. It brings consistency onto the project structure. I have changed a few things around in the sample project and turned it into a project template. My project structure looks like the following screen shot.
I got rid of the '_sample' folder. I have renamed the 'min' folder to 'libs' as this folder also contains the SOAP library as well as the jquery library. I have renamed 'sampleCode' to 'webresources' and left the vsdoc as it is. I have deleted most of the sample files from this solution as I want to use this project as a project template. I have kept a few files from the sample solution to use as templates if required.
You can download my project template from: Project Template.
By doing that you have same folder structure for all webresource projects using SOAP endpoints.
The following screen shot displays the structure of the new project created using the template.
Working with the files
the root folder contains the Sdk.soap.min.js and jquery_1.9.1.min.js files
the 'actions' folder contains all the custom action classes. The custom action will be created using Sdk.Soap.js Action Message Generator.
the 'entities' folder contains all the CRM entity classes. These classes will be used for early binding.
the 'message' folder contains all the other messages supported by the library. The library supports 202 different messages. You can add and remove the messages required by your project.
the 'images' folder contains all the images used in the HTML web resources.
the 'pages' folder contains all the HTML websesources
I have added a StartUp.htm and StartUp.js to the project template as starting webresources. You can modify them for your project or use as reference.
The following section displays the source code for StartUp.htm
This file will get the context for the webresource
This file contains the startEarlyBindingSample() function that the StartUp.htm webresource will call.
The following code displays the reference directive from the StartUp.js.
1: /// <reference path="../../vsdoc/Sdk.Soap.vsdoc.js" /> 2: /// <reference path="../../vsdoc/entities/Sdk.Account.vsdoc.js" /> 3: /// <reference path="../../vsdoc/jquery_1.9.1_vsdoc.js" />
That is all about the project structure. I hope this will give you enough information on how to setup a project structure for the Sdk.soap.js library.
Another feature that would be nice, would be a one click deployment into CRM...