none
"No Overload for method takes 2 arguments"

    Question

  • using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using ConsoleApplication1.SSRS; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { ReportingService2010SoapClient client = new ReportingService2010SoapClient(); TrustedUserHeader Myheader = new TrustedUserHeader(); CatalogItem[] CatalogItems = client.ListChildren( "/", false); } } }

    Anyone familiar with this error? Veyr simple program just to get a list of reports from SSRS 2012 web services.
    • Edited by GSS138 Tuesday, June 04, 2013 8:23 PM
    Tuesday, June 04, 2013 8:21 PM

Answers

  • It means what it says. You are trying to pass two arguments to a method that is expecting three or one or some other number.

    Looking at the code, it must be ReportingService2010SoapClient.ListChildren. I'm not familiar with this method, but a quick Google search leads me to the following guess for a fix.

                CatalogItem[] CatalogItems;
                client.ListChildren( "/", false, out CatalogItems);
    

    Tuesday, June 04, 2013 11:42 PM
  • Hi

    NTLM means the server use windows authentication.

    Demo source

    NetworkCredential myCreds = new NetworkCredential("username", "password", "domain"); CredentialCache myCredentialCache = new CredentialCache(); myCredentialCache.Add("ContoscoMail", 35, "Basic", myCreds); myCredentialCache.Add("ContoscoMail", 45, "NTLM", myCreds); client.Credentials = myCredentialCache.GetCredential("ContosoMail", 45, "NTLM");

    Friday, June 07, 2013 9:00 AM

All replies

  • It means what it says. You are trying to pass two arguments to a method that is expecting three or one or some other number.

    Looking at the code, it must be ReportingService2010SoapClient.ListChildren. I'm not familiar with this method, but a quick Google search leads me to the following guess for a fix.

                CatalogItem[] CatalogItems;
                client.ListChildren( "/", false, out CatalogItems);
    

    Tuesday, June 04, 2013 11:42 PM
  • Getting closer, thank you much Ante.  Now, the following code throws the following error:

    namespace ConsoleApplication1
    {
        class Program
        {
            static void Main(string[] args)
            {
                ReportingService2010SoapClient client = new ReportingService2010SoapClient();
    
                TrustedUserHeader Myheader = new TrustedUserHeader();
                NetworkCredential clientCredentials = new NetworkCredential("User", "password");
    
                Myheader.UserName = clientCredentials.UserName;
                
    
                CatalogItem[] CatalogItems;
                
                client.ListChildren(Myheader, "/", true, out CatalogItems);
    
                foreach(CatalogItem ci in CatalogItems)
                {
                    Console.WriteLine(0);
                };
              
            }
        }
    }

    The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'NTLM'.
    Thursday, June 06, 2013 4:47 PM
  • Hi

    NTLM means the server use windows authentication.

    Demo source

    NetworkCredential myCreds = new NetworkCredential("username", "password", "domain"); CredentialCache myCredentialCache = new CredentialCache(); myCredentialCache.Add("ContoscoMail", 35, "Basic", myCreds); myCredentialCache.Add("ContoscoMail", 45, "NTLM", myCreds); client.Credentials = myCredentialCache.GetCredential("ContosoMail", 45, "NTLM");

    Friday, June 07, 2013 9:00 AM