Test custom services using raw HTTP

You will need client id and client secret.
Client should be registered in AX at System administration -> Setup -> Azure Active Directory applications
All requests was tested using Fiddler and it's Composer->Scratchpad feature.
You can find implementation of calc service following this link.
There are couple of examples how you can test your services:


Make sure that empty line which dividing HTTP headers and body is empty, without space. Otherwise you will most probably get an error.

Request to get auth token:
POST https://login.windows.net/{TenantId}/oauth2/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: login.windows.net

TenantId - Open D365FO / ? (Sign at top right corner) / About / Licenses / This product is licensed to

Request to service:
POST https://{aos}.cloudax.dynamics.com/api/Services/VKOServiceGroup/VKOCalcService/calc HTTP/1.1
Content-Type: application/json
Accept: application/json
Accept-Charset: UTF-8
Authorization: Bearer {AuthToken}
Host: {aos}.cloudax.dynamics.com

         "arg1": 2,
         "arg2": 2,
         "operation": 0,
         "list": [{
             "a": 0,
             "a": 1,
         "subCalc": {
             "a": 5


SoapUI can form a correct request for you using wsdl https://{aos}.cloudax.dynamics.com/soap/Services/VKOServiceGroup?wsdl
You can use SoapUI to send request, you just need to manually add Authorization header with value Bearer {AuthToken}

Example of SOAP request:
POST https://{aos}.cloudax.dynamics.com/soap/services/VKOServiceGroup HTTP/1.1
Content-Type: text/xml
SOAPAction: http://tempuri.org/Calc/calc
Authorization: Bearer {AuthToken}
Host: {aos}.cloudax.dynamics.com

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dat="http://schemas.microsoft.com/dynamics/2013/01/datacontracts" xmlns:tem="http://tempuri.org" xmlns:dyn="http://schemas.datacontract.org/2004/07/Dynamics.AX.Application">
SOAPAction: http://tempuri.org/{External Name property from service}/calc






DaxOnline.org is free platform that allows you to quickly store and reuse snippets, notes, articles related to Dynamics AX.

Authors are allowed to set their own AdSense units.
Join us.

Blog Tags