Quantcast
Channel: Martin Dráb's Activities
Viewing all articles
Browse latest Browse all 17532

calling D365FO custom web service with REST API in the Logic app and specify call context (i.e. Multiple companies)

$
0
0

Hi All, 

I am trying to call Custom D365FO REST web service using client-id and ClientSecret in Logic App (i.e. HTTP Post). The web service executed the operation in the Default user context. I know that in the Soap version it is possible to switch the context/Company using      AX.CallContext callContext = new AX.CallContext() { Company = "XXXX" }. Which in turn generates 

<s:Header><h:CallContext xmlns:h="">schemas.microsoft.com/.../datacontracts" xmlns:i="">www.w3.org/.../h:Company><h:Language i:nil="true"/><h:MessageId i:nil="true"/><h:PartitionKey i:nil="true"/></h:CallContext></s:Header>

I would like to achieve the same in REST endpoint of this webservice. 

I tried the following: 

1. Added the call context in Body of the request 

   "CallContext": {
        "Company": "XXXX"
    },
2. Added CallContext in the header 
Nothing seems to work. Can someone advise how to switch the context?
Note: I don't want to add Company in data contract and then code does the company switching  

Viewing all articles
Browse latest Browse all 17532

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>