The Microsoft Dynamics CRM Team Blog
News and views from the Microsoft Dynamics CRM Team
SilverCrmSoap is a library built using the methods in Walkthrough: Use the SOAP Endpoint for Web Resources with Silverlight. The SilverCrmSoap library simplifies SOAP Silverlight development for CRM 2011 by providing a class that does a lot of the heavy lifting right out of the box.
If you are using the SOAP End Point, then the library will help simplify your project by removing the complexities of connecting to the SOAP End Point in Silverlight while providing additional tools to assist with your Silverlight project. In the end, it really boils down to where do you use SOAP instead of REST? You use SOAP when:
There are benefits to using the REST endpoint too, and being able to quickly leverage both end points in a project can be extremely helpful. You should use the REST End Point when:
You can find more information on the SOAP and REST End Points in the MSDN Article: Use Web Service Data in Web Resources (REST and SOAP Endpoint).
The SilverCrmSoap library is built to be added as a compiled DLL reference in a Silverlight projects. It facilitates making calls to CRM when used in a Silverlight Web-Resource.
Inside your Silverlight application solution in Visual Studio, add a reference to the compiled SilverCrmSoap.dll
Once referenced, there are three namespaces that assist with Silverlight development for CRM:
Built following the steps in Walkthrough: Use the SOAP Endpoint for Web Resources with Silverlight, this namespace provides access to the SOAP Endpoint. The SilverCrmSoap.CrmSdk also contains some examples for extending the base Entity class. In the SilverCrmSoap project a UserOwnedEntitiy class has been added that extends the Entity class and raises the appropriate event when a field is changed. By default the SOAP Entity object only raises a property changed event if the Attributes object itself is changed. In addition to the UserOwnedEntity class which specifies the default fields for user owned entities, an Annotation class has been added that inherits from the UserOwnedEntity, adding the specific fields for notes. This type of extension becomes important when you are attempting to facilitate data-binding.
The FetchXml namespace provides a set of classes built according to the FetchXml schema to allow deserialization of FetchXml to support the modifying parameters through code, i.e. objectifying FetchXml. You will want to do this because a query expression does not return column values from another entity, and yet the reason why QueryExpressions are used so widely is because of their ability to easily be modified through code. By de-serializing the FetchXml query string, you will be able to edit it’s values using objects, then serialize it to use in your queries
The SilverCrmSoap Library contains 3 helpers, the Xrmhelper, the FormHelper, and the SoapHelper.
The XrmHelper provides on-demand access to the JScript objects that are commonly used such as the Xrm.Page, context, etc. It is also able to determine if the control was loaded as a web-resource on a form or if it was loaded outside a form. When using this helper, it is important to either put the web-resource on the form or put it on an html page that provides access to the GlobalContext.
FormHelper takes the XrmHelper and provides a couple of additional quick access methods that utilize the JScript objects XrmHelper provides:
The SoapHelper was built to leverage the walkthrough for interfacing the SOAP End Point and provide a set of methods to launch the proper asynchronous call, simplifying access. One of the great things about these helpers is that you don’t need to specify the URL to use them. They leverage the context to correctly set the service URL. The SoapHelper provides a way to quickly connect to the SOAP End Point and a set of methods to jumpstart the begin statements of asynchronous SOAP calls:
My English is not good,I have a problem,when "service.BeginExecute(request, new AsyncCallback(EntityList_ClickCallback), service)", there in a probelem is " request error. This may be due to trying to cross-domain access to services but not have the correct cross-domain policy, or policy does not apply to SOAP services. You may need to contact the owner of the service, to publish a cross-domain policy file and make sure the file is allowed to send SOAP-related HTTP headers. This error may also be due to the use of the Web service proxy in the internal properties of the type without using InternalsVisibleToAttribute" do you kown this problem?