Compartilhar via


WSDL generation

In typical WCF services, the WSDL documents are generated dynamically. The WSDL documents for the native endpoint and the legacy endpoint are very large. It can take a few minutes for them to be generated. For this reason, static versions of these two WSDL documents are used for the Dynamics GP service. Instead of allowing WCF to generate the WSDL documents, the request for them is redirected to another service that returns the static versions of the documents. This allows the WSDL documents to be returned quickly when they are requested.

Using a WSDL document

Applications that access the endpoints for the Dynamics GP service typically don't retrieve the WSDL documents, so they are not affected by the static WSDL document. Development tools will need to retrieve the WSDL documents when connecting to the Dynamics GP service. Some development tools may not be able to retrieve a static WSDL document. If a development tool cannot retrieve the static WSDL document, do one of the following:

  • Enter the redirected URL directly. This URL is found at the top of the web page that is displayed when you access the endpoint with a web browser.
  • Change the endpoint configuration of the Dynamics GP service to use the dynamically-generated WSDL.

Switching to a dynamically-generated WSDL

The configuration file for the endpoint specifies whether the static WSDL or the dynamically-generated WSDL are used. The static WSDL documents are used for the default installation of Web Services for Microsoft Dynamics GP. You can change the configuration to use the dynamically-generated WSDL documents. To do this, complete the following procedure:

  1. Edit the configuration file for the endpoint.

    Using a text editor, open the configuration file for the endpoint you want to change. The configuration files are typically found in this location:

    C:\Program Files\Microsoft Dynamic\GPWebServices\ServiceConfigs\

    The configuration file for the native endpoint is named DynamicsGP.config. The configuration file for the legacy endpoint is named DynamicsGPLegacy.config.

  2. Change the behavior configuration for the endpoint.

    Locate the <services> element in the configuration file. The <service> element specifies the contract for the endpoint and the behavior for the WSDL generation.

    Legacy endpoint   The following value for the behaviorConfiguration attribute specifies that the static WSDL is used:

    <service name="Microsoft.Dynamics.GP.WebServices.LegacyContract.DynamicsGP" behaviorConfiguration="GPLegacyStaticMetadataBehavior">
    
The following value specifies that the dynamic WSDL is used:

<pre class="checklistscript" IsFakePre="true" xmlns="http://www.w3.org/1999/xhtml">&lt;service name="Microsoft.Dynamics.GP.WebServices.LegacyContract.DynamicsGP" behaviorConfiguration="GPDynamicMetadataBehavior"&gt;
**Native endpoint**   The following value for the behaviorConfiguration attribute specifies that the static WSDL is used:

<pre class="checklistscript" IsFakePre="true" xmlns="http://www.w3.org/1999/xhtml">&lt;service name="Microsoft.Dynamics.GP.WebServices.Contract.DynamicsGP" behaviorConfiguration="GPWCFStaticMetadataBehavior"&gt;
The following value specifies that the dynamic WSDL is used:

<pre class="checklistscript" IsFakePre="true" xmlns="http://www.w3.org/1999/xhtml">&lt;service name="Microsoft.Dynamics.GP.WebServices.Contract.DynamicsGP" behaviorConfiguration="GPDynamicMetadataBehavior"&gt;
  1. Save the configuration changes.

  2. Restart the Microsoft Dynamics GP Service Host.

    The Microsoft Dynamics GP Service Host must be restarted for this change to take effect. From the Start menu, locate the Administrative Tools group and choose Services. Find the entry for the Microsoft Dynamics GP Service Host. Right-click the entry and choose Restart.