How to: Add the CrmDiscoveryService Web Reference
[Applies to: Microsoft Dynamics CRM 4.0]
Find the latest SDK documentation: CRM 2015 SDK
The typical procedure to add a Web Reference to a Visual Studio project is shown in the following procedure. Note there are two URLs shown for the CrmDiscoveryService Web service. The one that you use depends on the method of authentication required by the Microsoft Dynamics CRM installation. For Microsoft Dynamics CRM Online, see How to Add the CrmDiscoveryService Web Reference: CRM Online.
- Create a C# or Visual Basic .NET project in Microsoft Visual Studio.
- In Solution Explorer, right-click References.
- Select Add Web Reference if you are using Visual Studio 2005. For Visual Studio 2008, select Add Service Reference, click Advanced, and then click Add Web Reference.
- In the URL field, paste the following string, replacing <server name> with the name of a Microsoft Dynamics CRM Server. The TCP port number in the Web service URL is optional and only required if Microsoft Dynamics CRM is installed to a nondefault Web site on the server.
For Active Directory Authentication (on-premise):
For Active Directory Authentication (IFD):
- Click Go.
- Edit the Web reference name. This is the name that you will put in the Using statement in the source code. For this example, type CrmSdk.Discovery.
- Click Add Reference.
The Microsoft Dynamics CRM CrmDiscoveryService Web service namespace is now available to your project. In the project source code, add one of the following statements:
[Visual Basic .NET]
You can now refer to the classes and methods that are in this SDK.
© 2010 Microsoft Corporation. All rights reserved.