title: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL
body: <p>I'm using <a href="https://ssrsphp.codeplex.com/" rel="nofollow noreferrer">SSRS SDK for PHP</a></p>
  <p>PHP Version 5.4</p>
  <p>WebServer: Centos 6.4</p>
  <p>MSSQL Server 2008 R2</p>
  <p>When I make</p>
  <pre><code>$ssrs_report = new SSRSReport(new Credentials(UID, PASWD), SERVICE_URL);
  </code></pre>
  <p>I got the following error</p>
  <pre><code>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&amp;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-&gt;SoapClient('http://172.16.4...', Array) #1 /var/www/emilio/SSRS/index.php(12): 
  SSRSReport-&gt;SSRSReport(Object(Credentials), 'http://172.16.4...') #2 {main} thrown in 
  /var/www/emilio/app/Libraries/SSRSReport/bin/SSRSReport.php on line 196
  </code></pre>
  <p><strong>I'm looking how to fix it and get the report trough the soap(<a href="https://ssrsphp.codeplex.com/" rel="nofollow noreferrer">SSRS SDK for PHP</a>).</strong></p>
  <p>I tried using <code>file_get_content()</code> and <code>curl</code> and both worked fine, then isn't connection problems, I have</p>
  <ul>
  <li>Soap Client  enabled</li>
  <li>allow_url_fopen is On</li>
  </ul>
  <p>this is the line where the sdk call the soap service</p>
  <pre><code>$executionServiceUrl=&quot;http://172.16.4.63/ReportServerURL?%2fTestFolder%2ftestClaimHdr&amp;rs:Command=Render/ReportExecution2005.asmx?wsdl&quot;;
  $options = array ( 'login' =&gt; 'xxxx\\xxxx', 'password' =&gt; 'xxxx', )
  
  $this-&gt;_soapHandle_Exe = new SoapClient($executionServiceUrl, $options);
  </code></pre>
  <p>Adding</p>
  <pre><code> try {
    $this-&gt;_soapHandle_Exe = new SoapClient($executionServiceUrl, $options);
  } catch (Exception $e) {
    var_export(libxml_get_last_error());
  }
  </code></pre>
  <p>I get the following array:</p>
  <pre><code>LibXMLError::__set_state(array(
        'level' =&gt; 3,
        'code' =&gt; 77,
        'column' =&gt; 43325,
        'message' =&gt; 'Premature end of data in tag html line 1',
        'file' =&gt; 'http://172.16.4.63/ReportServerURL?%2fTestFolder%2ftestClaimHdr&amp;rs:Command=Render/ReportExecution2005.asmx?WSDL',
        'line' =&gt; 1,
  )
  </code></pre>
  <p>According to <a href="http://www.xmlsoft.org/html/libxml-xmlerror.html" rel="nofollow noreferrer">xmlerror from libxml2</a></p>
  <blockquote>
  <p>level 3 = XML_ERR_FATAL = 3 : A fatal error</p>
  <p>code 77 =  XML_ERR_TAG_NOT_FINISHED = 77 : 77</p>
  </blockquote>
  <p>I have alredy set the <a href="http://technet.microsoft.com/en-us/library/cc281309%28v=sql.105%29.aspx" rel="nofollow noreferrer">Basic authentication</a> in the SSRS SERVER</p>
  <p><strong>Update</strong></p>
  <p>As @jwhaley58 said I changed to:</p>
  <pre><code>define(&quot;SERVICE_URL&quot;, &quot;http://172.16.4.63/ReportServerURL&quot;);
  $ssrs_report = new SSRSReport(new Credentials(UID, PASWD), SERVICE_URL);
  $ssrs_report-&gt;LoadReport2('testClaimHdr',NULL);
  </code></pre>
  <p>and I get:</p>
  <pre><code>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-&gt;ThrowReportException(Object(SoapFault)) #1 /var/www/emilio/SSRS/index.php(15): 
  SSRSReport-&gt;LoadReport2('testClaimHdr', NULL) #2 {main} thrown in 
  /var/www/emilio/app/Libraries/SSRSReport/bin/SSRSReport.php on line 590
  </code></pre>