Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Test Dynamics CRM Web API call using SoapUI

Posted on by 1,075

Hello,

Hope everyone staying safe and healthy. I am testing Dynamics CRM Web API connection using SoapUI.I am on Dynamics 365 on-premise and using NTLM authentication. GET method is working fine. But POST method is giving me below error, Can someone tell me what am I doing wrong? And how to troubleshoot this kind of errors? Any logs to see for details of error?

HTTP/1.1 401 Unauthorized
Content-Type: application/json; charset=utf-8
Server:
jsonerror: true
WWW-Authenticate: Negotiate
WWW-Authenticate: NTLM
Date: Sun, 21 Jun 2020 03:18:41 GMT
Content-Length: 91

{"Message":"There was an error processing the request.","StackTrace":"","ExceptionType":""}

Web-API-error.jpg

  • RE: Test Dynamics CRM Web API call using SoapUI

    I found answer for this. Since I have Dynamics 365 on-premise with IFD and using ADFS 3.0. ADFS won't allow NTLM connections. Our environment is configured Claims based authentication. In order to make this Web API call to work on/from any application/client, first that application/client has to be registered on ADFS to get authorization code and then use that code to get access token to authenticate. It is really hard way of doing it. I managed with some old connector (Partner-Hosted IFD) which worked with SOAP service instead Web API. So, I am good for now to continue in a old fashion of using SOAP services.

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Test Dynamics CRM Web API call using SoapUI

    Hi,

    Can you download Postman tool and try the same thing in that.

    www.postman.com/.../

    Also, you mentioned that GET is working with NTML Authentication, only post is not working. Can you enable tracing on server and check for the logs. Also check event viewer on web server for the error details.

    If found helpful, Please mark my answer verified.

  • RE: Test Dynamics CRM Web API call using SoapUI

    Bipin - Thanks for your prompt response. But still no luck. I am using NTLM authentication with a CRM System admin user. BTW, how to enable logs to see detailed errors?

  • Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Test Dynamics CRM Web API call using SoapUI

    Hi,

    Leadsourcecode and statuscode field value should not be in quote("1", "1"). It should be in below format.

    {

    "firstname" = "t";

    "lastname" = "p";

    "emailaddress1" = "t@p.com";

    "subject" = "subject";

    "leadsourcecode" = 1;

    "statuscode" = 930720002;

    }

    Make sure you are passing correct optionset value for leadsourcecode and statuscode.

    If found helpful, Please mark my answer verified.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans