title: SSRS Report executes directly but WCF ReportExporter.Export method returns null Result and no errors
body: <p>I have a report that is hosted in SQL Server 2012 SSRS and it executes fine through the browser. I am trying to run it using WCF as a Service Reference for the SSRS 2005 asmx from a ASP.Net web project and return it as a PDF using the <code>ReportExporter.Export()</code> method; however, it is not returning a result at all and the warnings array is empty.  So, how can I troubleshoot the process to see where the difficulty is?  I did not find any errors in the SSRS Log file even when I set it to verbose; nor did I find any errors in the standard SQL Log.</p>
  
  <p>Here is my code:</p>
  
  <p>NOTE: the call <code>ReportExporter.Export(..)</code> is to a  method that encapsulates the execution of the webServiceProxy to the Service Reference.</p>
  
  <pre><code>{ 
      IList&lt;SSRS_Reports.ParameterValue&gt; parameters = new List&lt;SSRS_Reports.ParameterValue&gt;();
      parameters.Add(new SSRS_Reports.ParameterValue { Name = "paramId", Value = _paramId.ToString() }); }
  
      byte[] result = null;
  
      string extension = string.Empty;
      string mimeType = string.Empty;
      string encoding = string.Empty;
      string reportName = "/baseFolder/ReceiptReport";
  
      SSRS_Reports.Warning[] warnings = null;
  
      string[] streamIDs = null;
      string uN = ConfigurationManager.AppSettings["rptUName"].ToString();
      string uP = ConfigurationManager.AppSettings["rptPWD"].ToString();
      string uD = ConfigurationManager.AppSettings["rptDomain"].ToString();
  
      //NOTE: the call "ReportExporter.Export(..) is to a  method that encapsulates the execution of the webServiceProxy to the Service Reference.
     ReportExporter.Export("ReportExecutionServiceSoap",
                           new System.Net.NetworkCredential(uN, uP, uD),
                           reportName,
                           parameters.ToArray(),
                           ExportFormat.PDF,
                           out result,
                           out extension,
                           out mimeType,
                           out encoding,
                           out warnings,
                           out streamIDs);
  
     if (result != null)
     {
         //create a file and then show in browser
         _mPDFFile = randomName() + ".pdf";
         _mPDFPath = HttpRuntime.AppDomainAppPath + "\\pdf\\" + _mPDFFile;
  
         //clear files older than today
         Lib.FileManager.ManageFiles(HttpRuntime.AppDomainAppPath + "\\pdf", "*.pdf", -1);
  
         if (File.Exists(_mPDFPath)) 
         { 
             File.Delete(_mPDFPath);
         }
  
         FileStream stream = File.Create(_mPDFPath, result.Length);
         stream.Write(result, 0, result.Length);
         stream.Close();
  
         return true;
      }
  }
  </code></pre>