XML response from OData services

If you call OData services in AX 7 (Dynamics 365 for Finance and Operations), you typically get data in JSON format, like this: { "@odata.context":"https://myaxinstance.cloudax.dynamics.com/data/$metadata","value":[ { "name":"ElectronicPaymentTypes","kind":"EntitySet","url":"ElectronicPaymentTypes" },{ "name":"ExpensePaymentDetails","kind":"EntitySet","url":"ExpensePaymentDetails" } … ] } JSON is a simple, lightweight format with good support in many tools, but sometimes you would rather get XML. XML is by …

Continue reading ‘XML response from OData services’ »

Open API for JSON-based custom services in AX 7

If you’re familiar with SOAP web services, you likely know that they use Web Services Description Language (WSDL) to document what operations a service provide, what parameters they accept, what they return and so on. This information can be used to generate proxy classes, which you can use to communicate with remote systems simply by …

Continue reading ‘Open API for JSON-based custom services in AX 7’ »

Discovery of JSON-based custom services in AX 7

If you download AX integration samples from GitHub, you’ll see (in JsonConsoleApplication project) that you can call JSON-based custom services by code like this: var request = HttpWebRequest.Create(ClientConfiguration.Default.UriString + "api/services/UserSessionService/AifUserSessionService/GetUserSessionInfo"); request.Headers[OAuthHelper.OAuthHeader] = OAuthHelper.GetAuthenticationHeader(); request.Method = "POST"; request.GetResponse(); It will call the operation and return its return value as JSON: { "$id":"1", "AOSLocaleName":"en-US", "AXLanguage":"EN-US", "Company":"DAT", "CompanyTimeZone":58, …

Continue reading ‘Discovery of JSON-based custom services in AX 7’ »

JSON-based custom service with parameters (AX 7)

Dynamics 365 for Operations deploys custom web services in two ways: as SOAP-based services and JSON-based services. AX developers are often familiar with SOAP services (which were used in AX 2012), but JSON-based ones are new to them. One particular challenge is passing arguments to a service. Let’s say we have an Add operation, which …

Continue reading ‘JSON-based custom service with parameters (AX 7)’ »