The library includes 2 files:
- Sdk.Soap.min.js This is the minified version of the library. The size of the file is around 164kb.
Advantages/BenefitsThe following lists some of the benefits/advantages of using this library.
The Sdk.Soap.vsdoc.js file contains comments for the developers. It will be used at design time to provide IntelliSense. You just need to add a reference directive on the top of your .js file as shown below:
/// <reference path="..path/Sdk.Soap.vsdoc.js" />
Choice of Early Bound and Late Bound Classes
The library provides the option to chose early binding and late binding in your code. I prefer the late binding but other people may prefer early binding classes as it provides the IntelliSense at design time for CRM entities. The solution also provides an early binding class entities generator to generate early bind classes for CRM entities. It is an equivalent of crmserviceutil.exe
Choice of Namespaces
The library supports the following 8 core IOrganisationService methods.
Associate,Create, Delete, Disassociate, Execute, Retrieve, RetrieveMultiple and Update.
The library provides the 4 different namespaces that implement these core methods:
- Sdk.Async: It executes the methods asynchronously. The method signatures provide the successCallBack and errorCallBack parameters.
- Sdk.Sync: It executes the methods synchronously.
- Sdk.jQ: It is an alternative approach to implementing asynchronous operations. It returns a jQuery.Deferred object/Promise. The initial state of the object is pending. The code will wait until the promise is resolved or rejected to execute the next line of the code. In short, it is like writing synchronous code for asynchronous calls. I will post some sample code to explain the difference between callbacks and promises at a later date.
This namespace depends on the existence of the jQuery.
- Sdk.Q:This is also the implementation of the “Promise” concept discussed above in Sdk.JQ.
Apart from the 8 core methods, the library supports 202 different methods. The library also provides a utility to create methods for custom action methods.
The Sdk.Soap.js library supports the three main query styles used with retrieve operations:
Things to consider
- The library was originally written for CRM2013. The Sdk.Xml.getEnvelopeHeader function specifies an SdkClientVersion value of 6.0. It does work for CRM2013 and CRM2015. It may change in future.
- It does not contain all the messages.Please check the documentation on the libarary page.
- Delete the namespaces that are not required
Sdk.Soap.js (contains the core libraries)
Sdk.Soap.js Entity Class Generator (tool to create libraries for CRM entities for ‘early binding’ and IntelliSense)
- Sdk.Soap.js Action Message Generator (tool to generate the support libraries for custom actions in your organization.
Sdk.Soap.js Samples (code sample using the library)
Here is the list of the downloads for the library: