I hope that someone has experienced this problem before so they can hel
shed some light to this problem. This is a long thread, but I want t
make sure that I don't miss anything.
Ok, I have developed a Data Search Web Service. The point of the We
Service is to give me back information based on some search criteria.
I have also developed a client application that will consume this We
Service. The Web Service and the Web Service Client will be deploye
onto 10 boxes throughout my client base. The point of the Web Servic
is to allow all the 10 sites to share data even though they are no
within the same LAN/WAN or Network Domain. The client app will b
aware of all the Web Services that I install and will consume them vi
an Asynchronous CallBack method. Ok here is the workflow.
On my client app, I have a listbox control that contains the Friendl
names of all my Web Service Installs. The end user fills in som
information and click the SEARCH Button. The code behind for tha
button loops through my listbox and packages up (using SOAP from M
WSE2 SP2) the information along with the user search criteria and call
the BEGININVOKE method of the Web Service Reference Class file (Derive
from Add Web Reference in my project). Then goes on to the next lis
Item. At this point, I really don't care about the return, because m
Call Back Handler will insert the results into a SQL table and the nex
page I display is a Results Page. On this results page, it looks up th
information in the SQL tables.
Here is the Problem:
I stumbled on an error when one of my servers had a different Tim
Zone. I resolved the problem by placing the appropriate time delays i
the Web Config for "defaultTtlInSeconds" and "timeToleranceInSeconds
and it alleviates the error, however, during my troubleshooting,
noticed that my "EndInvoke", specifically, the AsyncCallBack was neve
contacted when it encountered timing errors (SOAP HEADER Created and o
Expired Date) problems. I know that other errors that the Web Servic
traps for come back to the client and are handles correctly via m
AsyncCallBack handler however the Timing errors did not call th
AsyncCallBack Handler (thus never calling my EndInvoke). My bigges
concern is making sure that I call the ENDINVOKE regardless of succes
or failure of the Web Service Code. I have tried various places t
trap (Try/Catch) the exception from the timing errors but to date, hav
no luck. Can someone help me out or point me in the right direction?
Here is some of my code:
//After Page Validation, call this....
private void startProcessing()
{
<Build up list of Available sites to choose from>
foreach(ListItem l in lboxAvailResources.Items)
{
if(l.Selected)
{
//Now find the entry in the WSList to get the specifics
string strExpr = "key = '" + l.Value.ToString() + "'";
<Find Web Service URL via the strExpr>
UsernameToken userToken; //start packaging the WSE2 info
WSProxy oSearch = new WSProxyWse(GUID.ToString()
SiteID.ToString(), UserID.ToString());//Fill in basic Info
userToken = <Build Up User Token>
oSearch.Credentials = oHelper.GetCredentials(<NT Credentia
Information>);
oSearch.Url = <URL of the Web Service Associate with ListIte
Choosen>;
oSearch.Timeout = 60000;
SoapContext requestContext = oSearch.RequestSoapContext;
requestContext.Security.Tokens.Add(userToken);
requestContext.Security.Elements.Add(ne
Microsoft.Web.Services2.Security.MessageSignature(userToken));
requestContext.Security.Elements.Add(ne
EncryptedData(userToken));
switch(txbShow.Value.ToString())
{
case "GetPeople" :
sendPeopleSearch(oSearch, requestContext, UserID.ToString());
break;
<OTHER CASE STATEMENTS FOR DIFFERENT SEARCHES>
}
}
}
oHelper.Dispose();
oHelper = null;
dsInfo.Dispose();
dsInfo = null;
Session["QuerySites"] = aryInfo;
Response.Redirect("Results.aspx"); //This pages searches an
inserted information (of Searches that came back successfull or wit
Exceptions)
}
private void sendPeopleSearch(WSProxyWse oSearch, SoapContext
requestCOntext, string UserID)
{
<Set Search Criteria for oSearch object>
try
{
AsyncCallback cb = new
AsyncCallback(SearchHelper.SPersonCallBack);
IAsyncResult ar = oSearch.BeginSearchForPeople(<Information Needed
For Web Method Call>, cb,oSearch);
}
catch(System.Web.Services.Protocols.SoapException se)
{
<Log Error In Event Log & insert Error in SQL Results Table>
}
catch(Exception ex)
{
<Log Error In Event Log & insert Error in SQL Results Table>
}
finally
{
<Clean Up>
}
}
public static void SPersonCallBack(IAsyncResult ar)
{
try
{
WSProxyWse pf = (WSProxyWse) ar.AsyncState;
results = pf.EndSearchForPeople(ar); //This traps most of the
errors that can occur But NOT The Timing Errors...WHY??
}
catch(SoapException se)
{
<Log Error In Event Log & insert Error in SQL Results Table>
}
catch(Exception ex)
{
<Log Error In Event Log & insert Error in SQL Results Table>
}
finally
{
<Cleanup>
}
}
Is my implementation of the Async Callback Method incorrect? Where
else would I use a Try/Catch to get the exceptions?
Anyway, thanks in advance for any suggestions that you guys may have.

Signature
rviray
rviray - 28 Sep 2005 03:38 GMT
Has anyone seen this issue before, or have experienced the sam
symptoms
--
rvira