0
Answer

Result of webservice method appears to be stuck in cache

Nicholas Britton

Nicholas Britton

17y
2.1k
1

Can anyone help with this strange problem.  I have a windows client app which accesses data on a remote server via an xml web service. One particular class methos calls two methods on the web service in turn. Both are called synchronously. The first method call (execDDL) works fine but the second one (ws.getData()) does not appear to call at all except in debug mode. The getData method usually takes a few seconds to return causing the app to hang briefly - this does not happen in release mode and it does not return anything. What I find is the contents of the DataSet ds are unchanged from when it was created in the class constructor even though I called its Dispose() method. Is the app caching the result of the getData method from the first call?  There are no errors trapped and the troublesome method works fine when it is called elsewhere in the class. Here is the relevant code...

public void UpdateLinksDataSet(System.Collections.Hashtable hsh)

{

try

{

string sResult;

string sSQL = "INSERT INTO links (Category, site_name, siteURL, contact_email, banner_html,"

+ " display_size, link_type, display, site_desc, status, NeedToCheckHomeURL) VALUES ("

+ "'" + hsh["Category"].ToString() + "', "

+ "'" + hsh["site_name"].ToString() + "', "

+ "'" + hsh["HomeURL"].ToString() + "', "

+ "'" + hsh["contact_email"].ToString() + "', "

+ "'" + hsh["banner_html"].ToString() + "', "

+ "" + hsh["display_size"].ToString() + ", "

+ "'" + hsh["link_type"].ToString() + "', "

+ "" + hsh["display"].ToString() + ", "

+ "'" + hsh["site_desc"].ToString() + "', "

+ "'" + hsh["status"].ToString() + "', "

+ "" + hsh["NeedToCheckHomeURL"].ToString() + ") ";

ccDbAdmin.EnctrzDbAdmin ws = new ccDbAdmin.EnctrzDbAdmin();

sResult = ws.execDDL(sSQL, "#####", "#####");

ds.Dispose();

ds = ws.getData("SELECT siteURL FROM LINKS ORDER BY ID","SELECT","######","#####");

if (sResult != "Command executed successfully")

{

throw new Exception("There was a problem inserting the record into the remote database - '" + sResult + "'");

}

}

catch (Exception ex)

{

MessageBox.Show(ex.Message);

}

}

Thanks in advance for any suggestions

 

Nick