Dynamics HttpClient call never succeeds

爱⌒轻易说出口 提交于 2021-02-11 13:36:34

问题


I am developing a business central control add in where I need to call external web services. For this, I am using the HttpClient class in AL but no call succeeds.

if not Client.Get('https://google.com', Response)
    then begin
        responseText := Response.ReasonPhrase();
        Message(responseText);
        Error('didnt work');
    end;

It takes about 2.5-3 Minutes to finish the call. ResponseText is 'OK' and HttpStatusCode is '200' but the call always fails and goes into error handling block.

Reading the response with Response.Content.ReadAs(responseText); fails with a dynamics error message.

What am I missing? I already granted external access in extension management and tried with sandbox and on premise installs of latest 2019.


回答1:


Go to extension management, select your extension and from Manage menu, select Configure. In the Configure page, set AllowHttpCleintRequest to True.

enter image description here



来源:https://stackoverflow.com/questions/60153873/dynamics-httpclient-call-never-succeeds

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!