dardime Posted December 1, 2017 Share Posted December 1, 2017 Hi I encountered issue when running billing of of our sugar crm application. Pleae help me Thanks Here is the error message.: Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://portal.layer2.co.nz/voip/api/voipwebservice.php?WSDL' : Premature end of data in tag html line 2 in C:\xampp\htdocs\omnicrm\outbox\class.vibe.php:9 Stack trace: #0 C:\xampp\htdocs\omnicrm\outbox\class.vibe.php(9): SoapClient->SoapClient('http://portal.l...') #1 C:\xampp\htdocs\omnicrm\outbox\class.vibe.php(42): Vibe->vibe_api_voipwebservice() #2 C:\xampp\htdocs\omnicrm\outbox\callingdata.php(88): Vibe->getNumList('2017/11/01', '2017/11/30', 'nca', '', 'yes') #3 C:\xampp\htdocs\omnicrm\outbox\index.php(20): include('C:\xampp\htdocs...') #4 {main} thrown in C:\xampp\htdocs\omnicrm\outbox\class.vibe.php on line 9 My Code <?php include("config.php"); class Vibe { function vibe_api_voipwebservice() { ini_set('soap.wsdl_cache_enabled',0); // Disable caching in PHP $client = new SoapClient("http://portal.layer2.co.nz/voip/api/voipwebservice.php?WSDL"); return $client; } function vibe_radius_api() { ini_set('soap.wsdl_cache_enabled',0); // Disable caching in PHP $client = new SoapClient("http://portal.layer2.co.nz/api/radiuswebservice.php?WSDL"); return $client; } function vibe_information() { ini_set('soap.wsdl_cache_enabled',0); // Disable caching in PHP $client = new SoapClient("http://portal.layer2.co.nz/api/informationwebservice.php?WSDL"); return $client; } function db_conn() { $db_conn=mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } return $db_conn; } function directURL($url) { echo '<script> window.location="'.$url.'"; </script> '; } function getNumList($start,$end,$numType,$savecsv,$savedb) { $conn=$this->vibe_api_voipwebservice(); //echo "REQUEST:\n" . $conn ->__getLastRequest() . "\n" ; $search = array(); $type='detail'; if(isset($type)) { if($numType=="nca") { $getNumList = $conn->GetNCANumbersList(USERNAME, PASSWORD, $type, $search); } if($numType=="voip") { $getNumList = $conn->GetNumbersList(USERNAME, PASSWORD, $type, $search); } } if($savecsv=="yes") { $fp = fopen('csv/'.date("Ymdhis").'_a.csv', 'w')or die("can't open file"); } Quote Link to comment Share on other sites More sharing options...
dardime Posted December 1, 2017 Author Share Posted December 1, 2017 is it the cause of the wsdl link is empty or cannot access. Quote Link to comment Share on other sites More sharing options...
Solution BigB Posted December 3, 2017 Solution Share Posted December 3, 2017 @Dardime, I personally cannot see whats wrong here, I am not too familiar with sugar crm setup, to me the code above looks clean, however, I am a novice programmer, though my thoughts are as follows... This could also be a server side issue, a setting in php.ini or maybe we need to look into the other files to see whats going on there to see whats getting crunched and passed, If you could post the code from the files below or any other code you think may be relevant to this issue, and maybe the top gun programmers on this forum might be able to shoot you in the right direction: (Remember to dummy up any security risk code before posting) Related files: ...callingdata.php(88) ...index.php(20) .../305811-fatal-error-uncaught-soapfault-exception-wsdl-soap-error/SoapClient- ??? ...voipwebservice.php?WSDL Quote Link to comment Share on other sites More sharing options...
dardime Posted December 4, 2017 Author Share Posted December 4, 2017 Thank you so much BigB for your reply and help. i appreciate it a lot. Thanks Quote Link to comment Share on other sites More sharing options...
dardime Posted December 6, 2017 Author Share Posted December 6, 2017 This is already resolved. The reason is there is an issue with server side. Thanks BigD for helping me sort this out. 1 Quote Link to comment Share on other sites More sharing options...
BigB Posted December 7, 2017 Share Posted December 7, 2017 Any time, happy coding mate :-) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.