title: Powershell SOAP service - Cannot find an overload for .. and the argument count: "7"
body: <p>I'm writing a windows powershell script (first timer) which needs to call a service running on the same local machine. I have the following code which works for other fetch related methods, but this one gives me the following error:</p>
  
  <blockquote>
    <p>Cannot find an overload for "WriteReport" and the argument count: "7".</p>
  </blockquote>
  
  <pre><code>$svc = New-WebServiceProxy -Uri "http://localhost:55810/3/PublicService.svc?singlewsdl"
  $svc.WriteReport2(@($body.Id), 'PDF', 0, 0, '', $null, $false)
  </code></pre>
  
  <p>Output of <code>$svc.WriteReport</code>:</p>
  
  <pre><code>Cannot find an overload for "WriteReport2" and the argument count: "7".
  At C:\Users\Administrator\Desktop\App\App_Powershell\App-PS-CheckQueue.ps1:44 char:35
  +               $svc.WriteReport2(@($body.Id), 'PDF', 0, 0, '', $null, $false)
  +                                   ~~~~~~~~
      + CategoryInfo          : NotSpecified: (:) [], MethodException
      + FullyQualifiedErrorId : MethodCountCouldNotFindBest
  
  
  OverloadDefinitions
  -------------------
  string WriteReport(int[] Ids, Service.ReportFormatType Format, bool
  FormatSpecified, System.Nullable[Service.DefaultOrCustomType]
  DirectoryDefaultOrCustom, bool DirectoryDefaultOrCustomSpecified, string
  Directory, System.Nullable[Service.DefaultOrCustomType]
  ReportXslFileDefaultOrCustom, bool ReportXslFileDefaultOrCustomSpecified,
  string ReportXslFile)
  </code></pre>
  
  <p>I've <a href="http://pastebin.com/N4ru4DJE" rel="nofollow">posted the WSDL here on pastebin</a> (a truncated version): <a href="http://pastebin.com/N4ru4DJE" rel="nofollow">http://pastebin.com/N4ru4DJE</a></p>
  
  <p>I'm quite new to the whole windows environment (powershell, .NET, etc), can someone help me out or point me in the direction?</p>
  
  <hr>
  
  <p>Update:</p>
  
  <p>I tried updating my call to use 6 parameters and match up with the WSLD, but I still get the same error:</p>
  
  <blockquote>
    <p>Cannot find an overload for "WriteReport2" and the argument count: "6".
    $svc.WriteReport2(@($body.taskId), 'PDF', 'PDF', '...\Desktop\Reports', 'Default', '...\Desktop\Reports\Report.xml')</p>
  </blockquote>