In CRM 2011 you can generate a proxy of CRM’s web services so you can use any of the entities in your custom code in what is called early binding.
You need to have the SDK installed and use the tool crmsvcutil.exe which comes with it. For this example we’ll assume that the SDK has been deployed in the folder E:\CRM2011SDK. You can download the SDK here.
See this posting for information on how to obtain the URL to the Organization.svc service.
Open a command prompt window and type the following command:
Suppresses the banner.
The language to use for the generated proxy code. This can be either ‘CS’
or ‘VB’. The default language is ‘CS’. Short form is ‘/l:’.
A url or path to the SDK endpoint to contact for metadata.
The filename for the generated proxy code. Short form is ‘/o:’.
The namespace for the generated proxy code. The default namespace is the
global namespace. Short form is ‘/n:’.
Username to use when connecting to the server for authentication. Short
form is ‘/u:’.
Password to use when connecting to the server for authentication. Short
form is ‘/p:’.
Domain to authenticate against when connecting to the server. Short form
The name for the generated service context. If a value is passed in, it wi
be used for the Service Context. If not, no Service Context will be gener
Show this usage message. Short form is ‘/?’.
Device ID to use when connecting to the online server for authentication.
Short form is ‘/di:’.
Device Password to use when connecting to the online server for
authentication. Short form is ‘/dp:’.
You can download here an example of a proxy C# class generated with this tool.