Webservice 'Failed to load external entity'

mr.burnsmr.burns Member Posts: 39
edited 2012-08-11 in NAV Three Tier
Hi,

I have a Windows 7 Professional 32 Bit, IIS 7.5, PHP 5.3.13, Zend Framework 1.11 and Nav 2009 R2 RTC.
To start learning webservices and Navison I wanted to read the Nav companies using the standard webservice called SystemService.
The WSDL I can acces through a browser (http://navsrv:7049/myNavDB/WS/SystemService).

Then I have follwing PHP code isnide a SoapController.php to read the companies:
public function clientAction() {
			$client = new Zend_Soap_Client('http://navsrv:7049/myNavDB/WS/SystemService');
			
			$result =  $client->Companies();
						
			$companies = $result->return_value;
			echo "Companies:<br>";
			
			if (is_array($companies))
			{
			  foreach($companies as $company)
			  {
				echo "$company<br>";
			  }
			  $cur = $companies[0];
			}
			else
			{
			  echo "$companies<br>";
			  $cur = $companies;
			} 						
		}

But if I start the client-Action in a browser I get following error:
An error occurred
Application error
Exception information:
Message: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://navsrv:7049/myNavDB/WS/SystemService' : failed to load external entity "http://navsrv:7049/myNavDB/WS/SystemService&quot;

Stack trace:
#0 C:\inetpub\zf1root\library\Zend\Soap\Client\Common.php(51): SoapClient->SoapClient('http://navsrv:7...', Array)
#1 C:\inetpub\zf1root\library\Zend\Soap\Client.php(1032): Zend_Soap_Client_Common->__construct(Array, 'http://navsrv:7...', Array)
#2 C:\inetpub\zf1root\library\Zend\Soap\Client.php(1188): Zend_Soap_Client->_initSoapClientObject()
#3 C:\inetpub\zf1root\library\Zend\Soap\Client.php(1112): Zend_Soap_Client->getSoapClient()
#4 C:\inetpub\zf1root\application\controllers\SoapController.php(53): Zend_Soap_Client->__call('Companies', Array)
#5 C:\inetpub\zf1root\application\controllers\SoapController.php(53): Zend_Soap_Client->Companies()
#6 C:\inetpub\zf1root\library\Zend\Controller\Action.php(516): SoapController->clientAction()
#7 C:\inetpub\zf1root\library\Zend\Controller\Dispatcher\Standard.php(295): Zend_Controller_Action->dispatch('clientAction')
#8 C:\inetpub\zf1root\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#9 C:\inetpub\zf1root\library\Zend\Application\Bootstrap\Bootstrap.php(97): Zend_Controller_Front->dispatch()
#10 C:\inetpub\zf1root\library\Zend\Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#11 C:\inetpub\zf1root\public\index.php(26): Zend_Application->run()
#12 {main} Request Parameters:
array (
'controller' => 'soap',
'action' => 'client',
'module' => 'default',
)

I tried with google, but no success, any Idea what 'failed to load external entity' means and how to solve?

Thanks a lot!

Comments

  • ara3nara3n Member Posts: 9,256
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • mr.burnsmr.burns Member Posts: 39
    Hi Rahsed,

    thanks for reply. I didn't follow this block since Nav 2009 R2 RTC does not have any problem with NTLM Authentication.
    As I understand I can use 'normal' php classes from Zend framework to access NAV webservices.
    (correct me if I am wrong).

    I tested the return value of Zend_SOAP_Client against null, it returned something different from null, that means calling
    $client = new Zend_Soap_Client('http://navsrv:7049/myNavDB/WS/SystemService');
    
    seems to work correctly. The problem occurs in following line:
    $result =  $client->Companies();
    

    Does anybody know what I am doing wrongly?
    Thanks again for help!
Sign In or Register to comment.