NAV Web Service and PHP

I wanted to replace MySQL with NAV Web Service as a data source for my PHP web site.  I started to look around and found all I needed in Freddys Blog.  First post is about changes in authentication method of the web service, the later post displays the code needed to connect to the web service with php.

I have an php web on my Windows Home Server and needed to activate two more extensions to get things working.

Here are the php files that I used – PHP consume NAV Web Service

14 Replies to “NAV Web Service and PHP”

  1. Hi I have a problem while connecting navision webservice outside the domain could you please help me out in achieving this

    thnk u

  2. Hi Gunnar,

    sorry for the delay in my response.

    Yes I changed the authentication but the problem with my firewall and now it is working fine build a proxy server using PHP and now working on integrating with Android app and another PHP application.

    Indeed ur post is a great help for me. Thank you!!


  3. Gunnar thanx for the reply, I keep getting the same error do you have any idea what causes this?

    When i run the script I get this error:

    PHP Fatal error: SOAP-ERROR: Parsing WSDL: Couldn’t load from ‘’ : Start tag expected, ‘<' not found
    in E:wwwrootFinancenavphptest.php on line 26
    PHP Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from '; : Start tag expected, 'SoapClient(‘https://xxxx…’)
    #1 {main}
    thrown in E:wwwrootFinancenavphptest.php on line 26

    When I go to the same URL in a browser, and use the same credentials I get a WDSL back….


    I am running PHP 5.5.11 on Windows, also tested on Linux

    Thnx in advance


      1. GUnmar, I user Navonazure, so I can not check those settings. For now I only try to connect with your standard script, so is that with XMLPorts? I the license model of NavonAzure I see an additional option you can buy (100 pack XMLports) maybe I also need to buy that.

        1. Gunmar, I continued testing, I can connect and get a response from the environment when I use SoapUI with NTLM. But when I use this PHP script I keep getting the same error (see above)

          Please help

  4. Hi Gunnar,

    I have done several PHP app that connect to NAV webservice with no problem.
    Now I have a customer with NAV 2015 running on AZURE. I thought it will be just the same, until I encountered this familiar error:

    Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn’t load from : Start tag expected, ‘<' not found in D:homesitewwwroot

    I have fix the same error so many times with the same solution. But now I don't know what to do anymore. The error still occurred.

    I even try the solution on this blog:

    But the result is just the same.

    Maybe its because of the AZURE? I have no idea.
    Please advice.

    1. Had the same issue. Looked for a solution for hours, but didn’t find any. Obviously the fault is within NTLM somewhere. I tried the Odata instead ( and that did the trick to access, modify and delete the data. Still it didn’t let me to access codeunits so the logic needed to be on the PHP side, which was not ideal as I had nice codeunit written which worked well on non-azure server where I had the test environment.

  5. Hello,

    i have a problem and I am a beginner in PHP.

    I have a website and I want to get the Information from Navision in there.
    I already create a page and published it.

    But i can’t connect it with PHP. Do you have a simple example, how to connect to Navision from PHP.

    Thank you.

    1. Look for Freddy’s blog @Microsoft. You will see examples on how to connect to NAV from PHP. Just remember to use the NavUserPassword authentication method in NAV and Basic Authentication method in PHP

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.