Nav Web Services Authentication problems

I've made several web services (both SOAP and ODATA) in Nav, and when I call these from a Visual Studio program, they work well. BUT if I test them from a Web Service Test program, e.g. Boomerang (Google Chrome), SOA Client (Firefox), SoaUI, all tests returns Authentication error (401). I've tried to alter the authentication types, and even set the NAV to use NTLM authentication without any success.
A webshop programmer who should consume one of my webservices from a PHP program had a similar problem. We digged a lot in the Internet, and there was several propositions to what to do, but nothing worked.
Is there anybody in here, who might have any clue for a solution? That would be great!

Best Reagards Jes Kristensen

Comments

  • zohaibu95@hotmail.comzohaibu95@hotmail.com Member Posts: 223
    edited 2017-01-24
    Yeah its a issue. Right now i m working on SOAP webservices. It works well with Visual studio but not with tools like SOAP UI, POSTMAN etc.
    Try webservice studio. Hope this works with your service.

    Link to download: https://webservicestudio.codeplex.com/

    If it does not work, don't worry it happens. Just try to consume in Visual studio or some other client it will work. :)

    mqwb54l05zsr.png
    Best Regards
    Zohaib Ahmed
    Dynamics NAV ERP Technical Consultant.

    please like / agree / verify my answer, if it was helpful for you. thanks.
  • Wisa123Wisa123 Member Posts: 308
    Don't use "UseDefaultCredentials" <- doenst really work for me
    Try System.Net.WebPermission.
    Austrian NAV/BC Dev
  • zaidtariqzaidtariq Member Posts: 52
    @Wisa123 is right, when you try to use the webservice remotely the "UseDefaultCredentials" does not works.
    Best Regards:
    Zaid Tariq
    Dynamics NAV/365 BC Developer at Dynamics 360

    please like / agree / verify my answer, if was helpful.
  • Jes_KristensenJes_Kristensen Member Posts: 6
    Thank you for your quick replies :)
    But it is not actualy calling the web service from a Visual Studio project, which is the problem - it works weel. The main problem is the authentication problems from the various test clients and plugins or joust calling a Nav web service from a non Visual Studio project. The mentioned Webservice Studio / Codeplex (from 2008) which should work, is a Visual Studio project too, and therefore it will work (but good to know, there is at least one test program whick works for a Nav Web Service!). It seems to Navision web services only can be called from a Visual Studio project, and from no other platforms, neither the common test tools nor e.g. a PHP program.
    It would be very nice if I am wrong, and somebody knows how to call a web service from a non Visual Studio platform :)
    Best regards Jes Kristensen
  • zohaibu95@hotmail.comzohaibu95@hotmail.com Member Posts: 223
    @Jes_Kristensen its not a visual studio project. Its a tool for testing the SOAP based webservices. Its a project developed in .NET. You can use this tool. I find useful when i was testing my webservice.

    Also, please check the SOAPUI tool if you didn't.

    Hope this helps. :)
    Best Regards
    Zohaib Ahmed
    Dynamics NAV ERP Technical Consultant.

    please like / agree / verify my answer, if it was helpful for you. thanks.
  • Jes_KristensenJes_Kristensen Member Posts: 6
    I've tried SoapUI - the same, authentication error 401...it seems that a Nav web service exclusively can be called from at .Net application and not from nothing else... I hope I'm wrong and you are very welcome to convince me about it if so :smile:
    Best regards Jes Kristensen
  • zohaibu95@hotmail.comzohaibu95@hotmail.com Member Posts: 223
    I've tried SoapUI - the same, authentication error 401...it seems that a Nav web service exclusively can be called from at .Net application and not from nothing else... I hope I'm wrong and you are very welcome to convince me about it if so :smile:
    Best regards Jes Kristensen

    Yes and for future purpose use WebStudio tool which i have mentioned above its great and works like a charm with NAV web service. :) Some days ago i was facing the same 401 authorization issue but trust me this tool saves me. :)
    Best Regards
    Zohaib Ahmed
    Dynamics NAV ERP Technical Consultant.

    please like / agree / verify my answer, if it was helpful for you. thanks.
  • Jes_KristensenJes_Kristensen Member Posts: 6
    I think I'll rephrase my question to: Is it possible to call a Nav Web Service from other applications than .Net applications, e.g. PHP, without getting authentication error (401)?
  • ftorneroftornero Member Posts: 524
    I've tried SoapUI - the same, authentication error 401...it seems that a Nav web service exclusively can be called from at .Net application and not from nothing else... I hope I'm wrong and you are very welcome to convince me about it if so :smile:
    Best regards Jes Kristensen

    SoapUI works with NAV Webservices, at least the 5.3 version.

    You need to fill the Username and Password in the Request Properties.

    Regards.
  • zohaibu95@hotmail.comzohaibu95@hotmail.com Member Posts: 223
    edited 2017-01-25
    I think I'll rephrase my question to: Is it possible to call a Nav Web Service from other applications than .Net applications, e.g. PHP, without getting authentication error (401)?

    Yes you can. Not only php but from any platform.

    For PHP have a look: https://blogs.msdn.microsoft.com/freddyk/2010/01/19/connecting-to-nav-web-services-from-php/

    https://www.adv-usa.com/2016/06/29/connecting-to-dynamics-nav-web-services-using-php/
    Best Regards
    Zohaib Ahmed
    Dynamics NAV ERP Technical Consultant.

    please like / agree / verify my answer, if it was helpful for you. thanks.
  • Jes_KristensenJes_Kristensen Member Posts: 6
    Thank you - good to have some guides to developers who must call our web services from PHP. :smile:
  • zohaibu95@hotmail.comzohaibu95@hotmail.com Member Posts: 223
    @Jes_Kristensen you are welcome. Please accept my answer if it is helpful for you. :)
    Best Regards
    Zohaib Ahmed
    Dynamics NAV ERP Technical Consultant.

    please like / agree / verify my answer, if it was helpful for you. thanks.
  • yuranyuran Member Posts: 4
    open CustomSettings.config file and replace
    <add key="ServicesUseNTLMAuthentication" value="false"/>
    with
    <add key="ServicesUseNTLMAuthentication" value="true"/>
Sign In or Register to comment.