Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Stop-Go
Starting Member
3 Posts |
Posted - 2011-04-08 : 16:04:12
|
I have not found this answered anywhere. I have a CLR function that exectues a webmethod call of my .NET application (.asmx). The web service successfully executes when called directly but when called via the CLR it times out after 100 seconds with the following error:Msg 6522, Level 16, State 1, Line 1A .NET Framework error occurred during execution of user-defined routine or aggregate "fn_ExecuteReport":System.Net.WebException: The operation has timed outSystem.Net.WebException: at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request) at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at DD.WebServices.WebExec.ExecuteReport(String ddBotID, String serverKey, Int32 ddUserID, String reportReportTypeList, String deliverToUserList) at ExecuteReport.GetResult(Int32 userID, SqlString reportList, SqlString deliverToUserList) I have increased the web service proxy timeout in fn_ExecuteReport without effect:WebExec svc = new WebExec();svc.Timeout = 3600000; // set timeout to 1 hourresult = svc.ExecuteReport(userID, reportTypeList.ToString(), deliverToUserList.ToString());I want to capture the returned result so executing the webservice asynchronously is not a solution. Where else might I override timeout settings for the SQL CLR call? Thanks for any help you can provide. |
|
Stop-Go
Starting Member
3 Posts |
Posted - 2011-04-09 : 22:04:41
|
Changing the web service proxy call from synchronous to asynchronous had no effect, so apparently it's not this call that's timing out. I'm at a loss.Synchronous:WebExec svc = new WebExec();svc.Timeout = 3600000; // set timeout to 1 hourresult = svc.ExecuteReport(userID, reportTypeList.ToString(), deliverToUserList.ToString());Asynchronous:WebExec svc = new WebExec();IAsyncResult result = svc.BeginExecuteReport(userID, reportTypeList.ToString(), deliverToUserList.ToString(), null, null);result.AsyncWaitHandle.WaitOne();retStr = svc.EndExecuteReport(result); |
 |
|
Stop-Go
Starting Member
3 Posts |
Posted - 2011-04-11 : 23:48:52
|
For a few reasons I decided to build a little console app to execute the web service rather than use SQL CLR, one being the timeout issue. I'd still like to know how to invoke long-running web service calls via SQL CLR so I'll buy a beer for anyone who can tell me. |
 |
|
|
|
|
|
|