Method Community

 

Service reference fails in C# (FYI: found a fix myself)

Last post 01-24-2013 12:04 PM by igotfryd. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 01-24-2013 12:04 PM

    Service reference fails in C# (FYI: found a fix myself)

    I added service reference to Method API and tried to run:

    ----------------------------------------------------------------------

    using (ServiceSoapClient proxy = new ServiceSoapClient("ServiceSoap"))
    {
     try
     {
      String tableList = proxy.MethodAPITableListV2(companyAccount, userName, password, "");
      Console.WriteLine("returned table list:{0}", tableList);
     }
     catch (Exception e)
     {
       Console.WriteLine("Error: {0}",e.Message);
     }

    Console.ReadLine();
    }

    -----------------------------------------------------------------------

    Kept getting XML deserialization error back. It turns out I simply needed to change the following variable in my binding configuration

    App.config:

    <system.ServiceModel>

    <bindings>

    <basicHttpBinding>

    <binding name="ServiceSoap">

    <readerQuotas maxStringContentLength="65536" />

    There is a lot of other info in that config, but I outlined the one that caused the issue.

    Thanks,

    ilya

Page 1 of 1 (1 items)