Where's the timeout property gone?

Discussion in 'Control Panel API' started by DonRox, Jun 6, 2013.

  1. Hi guys ... I'm a relatively new DASP client. Lots of pieces but it's too bad more of them aren't pulled together in a more automated way.

    I used the previous comments on this thread to add a page to my site that backs up my db, gzips it and keeps 3 copies of it on my personal space. Nice. Thanks for the sample code.

    Since I am new I started with .net 4.5. I would LOVE to see the API update with true async/await supported methods. In particular

    Task<string> Sql2012CreateBackupAsync(apiKey, databaseName);

    then I can await this call in my MVC controller. So much easier to use. I would like to see the backup command return the file name of the .bak file so it's easier to gzip and rename/delete once the backup completes.

    And of course an actual CreateZipBackupAsync() call would just do the work for me. I'd far rather re-use something than write/support my 1-off.

    FInally, I run this on my web site, any idea why my server IP address changes? I have had to add 2 entries to my whitelist. How often will it change? That makes it hard to automate stuff cuz I have to check every day on it.
     
  2. For your IP address question, the server IP address that you see in your Control Panel is different than the server's outbound IP address.

    There is actually a pool of outbound IP addresses, if you would like to know the specifics of the pool you should open up a ticket with support and we will provide them to you so that you can add them all to your whitelist.
     
  3. I can't set the Timeout. Is the API changed?

    Code:
    CustomerApiSoapClient DASPApiWebservice = new CustomerApiSoapClient();
                    
    DASPApiWebservice.Timeout = (int)Application["webserviceTimeout"];
    
    
     
  4. Bruce

    Bruce DiscountASP.NET Staff

    we have not made change to the API since April 2013.
     
  5. that's kinda what I thought. I'll just try adding the new ones as I see them and will eventually self-discover.
     
  6. Instantiating a CustomerApiSoapClient class instance indicates that you've added a "Service Reference" in Visual Studio which results in client side code for the API being generated based on WCF technology - the resulting CustomerApiSoapClient class code descends from System.ServiceModel.ClientBase and will subsequently use a WCF basicHttpBinding (SOAP over WCF).

    A System.ServiceModel.ClientBase class descendant has no Timeout property and this is the problem you're seeing. You can of course use WCF client side code with the DASP CP API if you want to - you just need to develop your client side code with this in mind (e.g. for controlling a client side timeout you'd be looking at svcClient.Endpoint.Binding.*Timeout properties).

    The original sample application code referenced in this thread implements things in the old school .NET 2.0 traditional SOAP way because it was developed before WCF really took off. That sample project includes a "Web Reference" and not a "Service Reference". A web reference results in client side code for the API being generated based on traditional .NET framework SOAP classes - the resulting CustomerApi class code decends from System.Web.Services.Protocols.SoapHttpClientProtocol and a System.Web.Services.Protocols.SoapHttpClientProtocol descendant does have a Timeout property.

    If I were developing a new web service client application today personally I'd go down the WCF route but either way will work fine.
     

Share This Page