Consume Web Services
The Microsoft Dynamics AX programmability model now supports services. This means you can consume external Web services from X++ code. You can also consume Web services that are hosted by Microsoft Dynamics AX from .NET Framework languages such as C#. For example, your C# code can call a document service that is provided by Application Integration Framework (AIF).
The ability to consume Web services from X++ and C# provides new integration scenarios such as the following:
Integration for shipping and delivery information.
Integration for tax calculation.
Integration for processing credit card information.
To consume an external Web service from X++, you must first create a reference to the Web service. After creating a reference to the Web service, you can invoke it from X++ and see the available methods with IntelliSense. Calling and managing external Web services is done entirely within Microsoft Dynamics AX.
To illustrate how to consume a Web service, the following topics show you how to call the Microsoft Live Search Web service. To consume an external Web service, you must:
The following topics illustrate how to call an AIF document service from your C# or other .NET Framework code. In order to call the document service, you must expose it as a Web service.
The concept of an integer is represented in AIF by the X++ int keyword, and by System.Int32 in .NET Framework languages such as C#. The following topic describes the automatic conversions of data values between the primitive types in the client and AIF services.
To troubleshoot issues with Web services, you can enable tracing by editing the Web.config file. The following topic describes how to trace a call from an external client to an X++ service exposed as a Web service in Microsoft Dynamics AX.