Is there some permission required to allow a user to specify LogonAsUser in a request to the Query Service? I can successfully call the service, however when I include LogonAsUser I get "Failed to log on to Microsoft Dynamics."
I read in article https://technet.microsoft.com/en-us/library/hh582244.aspx that "The data contract for the call context is not published as part of the Web Service Description Language (WSDL) files for the query service and the metadata service. If you want to set any call context values for these services, you must create the code to set the values for the system service call."
I've done this and when I specify a Company this works, however when I also include LogonAsUser I get the error "Failed to log on to Microsoft Dynamics."
Example header of the request below:
<s:Envelope xmlns:a="www.w3.org/.../addressing" xmlns:s="www.w3.org/.../soap-envelope">
<s:Header>
<a:Action s:mustUnderstand="1">tempuri.org/.../ExecuteQuery</a:Action>
<a:MessageID>urn:uuid:d506fbb5-9eac-4517-9d38-8bbb85ec785b</a:MessageID>
<a:ReplyTo>
<a:Address>www.w3.org/.../anonymous</a:Address>
</a:ReplyTo>
<CallContext xmlns="schemas.microsoft.com/.../datacontracts">
<Company>company</Company>
<LogonAsUser>domain\user</LogonAsUser>
</CallContext>
</s:Header>
...
*This post is locked for comments
I have the same question (0)

Report
All responses (
Answers (