Throw SoapFault exception: [WSDL] SOAP-ERROR: WSDL analysis

I am using SSRS SDK for PHP

PHP version 5.4

WebServer: Centos 6.4

MSSQL Server 2008 R2

When i do

$ssrs_report = new SSRSReport(new Credentials(UID, PASWD), SERVICE_URL); 

I got the following error:

 Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://172.16.4.63/ReportServerURL/Pages/ReportViewer.aspx?%2fTestFolder%2ftestClaimHdr&rs:Command=Render/ReportExecution2005.asmx?wsdl' : Premature end of data in tag html line 1 in /var/www/emilio/app/Libraries/SSRSReport/bin/SSRSReport.php:196 Stack trace: #0 /var/www/emilio/app/Libraries/SSRSReport/bin/SSRSReport.php(196): SoapClient->SoapClient('http://172.16.4...', Array) #1 /var/www/emilio/SSRS/index.php(12): SSRSReport->SSRSReport(Object(Credentials), 'http://172.16.4...') #2 {main} thrown in /var/www/emilio/app/Libraries/SSRSReport/bin/SSRSReport.php on line 196 

I am looking for how to fix this and get a report through soap ( SSRS SDK for PHP ).

I tried using file_get_content() and curl , and both worked fine, then this is not a connection problem, I have

  • Soap Client Enabled
  • allow_url_fopen is enabled

this is the line where sdk calls the soap service

 $executionServiceUrl="http://172.16.4.63/ReportServerURL?%2fTestFolder%2ftestClaimHdr&rs:Command=Render/ReportExecution2005.asmx?wsdl"; $options = array ( 'login' => 'xxxx\\xxxx', 'password' => 'xxxx', ) $this->_soapHandle_Exe = new SoapClient($executionServiceUrl, $options); 

Adding

  try { $this->_soapHandle_Exe = new SoapClient($executionServiceUrl, $options); } catch (Exception $e) { var_export(libxml_get_last_error()); } 

I get the following array:

 LibXMLError::__set_state(array( 'level' => 3, 'code' => 77, 'column' => 43325, 'message' => 'Premature end of data in tag html line 1', 'file' => 'http://172.16.4.63/ReportServerURL?%2fTestFolder%2ftestClaimHdr&rs:Command=Render/ReportExecution2005.asmx?WSDL', 'line' => 1, ) 

According to xmlerror from libxml2

Level 3 = XML_ERR_FATAL = 3: Fatal Error

code 77 = XML_ERR_TAG_NOT_FINISHED = 77: 77

I have alredy set Basic authentication to SSRS SERVER

Update

Like @ jwhaley58 said I changed to:

 define("SERVICE_URL", "http://172.16.4.63/ReportServerURL"); $ssrs_report = new SSRSReport(new Credentials(UID, PASWD), SERVICE_URL); $ssrs_report->LoadReport2('testClaimHdr',NULL); 

and I get:

 Fatal error: Uncaught exception 'SSRSReportException' in /var/www/emilio/app/Libraries/SSRSReport/bin/SSRSReport.php:590 Stack trace: #0 /var/www/emilio/app/Libraries/SSRSReport/bin/SSRSReport.php(326): SSRSReport->ThrowReportException(Object(SoapFault)) #1 /var/www/emilio/SSRS/index.php(15): SSRSReport->LoadReport2('testClaimHdr', NULL) #2 {main} thrown in /var/www/emilio/app/Libraries/SSRSReport/bin/SSRSReport.php on line 590 
+3
source share
1 answer

Some gochas that I found only through the trial version and the error are some configuration problems, on the server running the report server service, make sure that your rsreportserver.config file has been modified to provide basic authentication. By default, if I understand it correctly, it wants to get a more reliable type of connection, but for sdk you need to allow simple name and password passing. This means that you need to add your authentication methods in the authentication settings.

for example,

In C: \ Program Files \ Microsoft SQL Server \ MSRS11.1 \ Reporting Services \ ReportServer \ rsreportserver.config (different for the server and version, but you get the idea.)

 <Authentication> <AuthenticationTypes> <RSWindowsNTLM/> <RSWindowsBasic/> ##you need to add this one## </AuthenticationTypes> <RSWindowsExtendedProtectionLevel>Off</RSWindowsExtendedProtectionLevel> </Authentication> 

IIRC, you will need to restart the service for it to take effect.

In addition, if you are trying to run RenderAs, some of the template files used to fill the headers have a place in them below, which will prevent rendering in the form of Excel, PDF, etc., if this has not been fixed since I worked over it.

I am looking at the code you provided, I may not read it correctly, but it looks like you are trying to explicitly identify the report you need in the execution url. If this is actually what you are doing, I believe that the correction will only consist in determining the database of reports to which you are connecting, so for your example the URL should be http://172.16.4.63/ReportServer/ . After this connection, you will use the LoadReport2 function to indicate which report you need.

Finally, where do you have the name of the report, it looks like you have a subdirectory called testfolder? if so, you need your report name to be "/ TestFolder / testClaimHdr" in the call to LoadReport2.

Hope this helps.

+1
source

Source: https://habr.com/ru/post/1415985/


All Articles