Export (0) Print
Expand All

How to: Adding the MetadataService Web Reference

banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Find the latest SDK documentation: CRM 2015 SDK

There are two ways to add the Web service reference or Web Services Description Language (WSDL) to your program. You can add the Web service URL directly or you can download the WSDL from the Microsoft Dynamics CRM Web application.

To add the Web service reference using the URL using Visual Studio 2005

  1. Open your Microsoft Visual C# or Microsoft Visual Basic .NET project in Microsoft Visual Studio.
  2. In Solution Explorer, right-click References.
  3. Choose Add Web Reference.
  4. In the URL field, paste the following string, replacing <server name> with the name of your Microsoft Dynamics CRM Server and organizationName with the name of your organization. The TCP port number in the Web service URL is optional and only required if Microsoft Dynamics CRM is installed to a non-default Web site on the server.
    http://<servername[:port]>/mscrmservices/2007/metadataservice.asmx?WSDL&uniquename=organizationName
    
  5. Click Go.
  6. Edit the Web reference name. This is the name that you will put in the Using statement in your source code. For this example, enter MetadataSdk.
  7. Click Add Reference.

The Microsoft Dynamics CRM metadata Web service is now added to your project. In your source code you can refer to the classes available in this SDK.

To Add the Web service by using the downloaded WSDL file using Visual Studio 2005

  1. In the Microsoft Dynamics CRM Web application, click Settings, and then click Customization.
  2. Click Download Web Service Description Files.
  3. Click the icon by Metadata Web Service. The WSDL will open in a browser window.
  4. Save the file to your local computer with the file name MetadataService.asmx.
  5. Open your Visual C# or Visual Basic .NET project in Microsoft Visual Studio 2005.
  6. In Solution Explorer, right-click References.
  7. Choose Add Web Reference.
  8. In the URL field, type the path of the file that you saved to you local computer. For example: C:\DownloadWsdl\MetadataService.asmx
  9. Click Go.
  10. Edit the Web reference name. This is the name that you will put in the Using statement in your source code. For this example, enter MetadataSdk.
  11. Click Add Reference.

To Add the Web service reference using the URL using Visual Studio 2008

  1. Open your Microsoft Visual C# or Microsoft Visual Basic .NET project in Microsoft Visual Studio 2008.
  2. In Solution Explorer, right-click References.
  3. Choose Add Service Reference.
  4. Click Advanced.
  5. Click Add Web Reference.
  6. In the URL field, paste the following string, replacing <server name> with the name of your Microsoft Dynamics CRM Server and organizationName with the name of your organization. The TCP port number in the Web service URL is optional and only required if Microsoft Dynamics CRM is installed to a non-default Web site on the server.
    http://<servername[:port]>/mscrmservices/2007/metadataservice.asmx?WSDL&uniquename=organizationName
    
  7. Click Go.
  8. Edit the Web reference name. This is the name that you will put in the Using statement in your source code. For this example, enter MetadataSdk.
  9. Click Add Reference.

The Microsoft Dynamics CRM metadata Web service is now added to your project. In your source code you can refer to the classes available in this SDK.

See Also

Other Resources


© 2010 Microsoft Corporation. All rights reserved.


Show:
© 2015 Microsoft