T
Tod Johnson
Hello all,
I'm wondering if anybody else can say me the best practice how can I
write stable communication with the WebService when the connection is
established through GPRS. I mean the GPRS connection could be broken on
the calling on series of WebMethods:
MyForm : Form
{
MyForm()
{
Init();
}
void Init()
{
try
{
dropDown1.DataSource = proxy.WebMethod_GetData1();
dropDown1.DataBind();
} catch { // suppress exception and what to do next? }
// at this point the connection is broken
dropDown2.DataSource = proxy.WebMethod_GetData2();
***
*** webmethod throws exception
***
dropDown2.DataBind();
dropDown3.DataSource = proxy.WebMethod_GetData2();
}
}
My question is, how can I catch correctly this exception? Have I try
to restore connection and after that return to execution? I've noticed
that after exception the WebService is not working anymore and I must
reinit it or smth?
I know that it's the common problem and there must be good patterns
for that.
Thanks in advance,
Tod
I'm wondering if anybody else can say me the best practice how can I
write stable communication with the WebService when the connection is
established through GPRS. I mean the GPRS connection could be broken on
the calling on series of WebMethods:
MyForm : Form
{
MyForm()
{
Init();
}
void Init()
{
try
{
dropDown1.DataSource = proxy.WebMethod_GetData1();
dropDown1.DataBind();
} catch { // suppress exception and what to do next? }
// at this point the connection is broken
dropDown2.DataSource = proxy.WebMethod_GetData2();
***
*** webmethod throws exception
***
dropDown2.DataBind();
dropDown3.DataSource = proxy.WebMethod_GetData2();
}
}
My question is, how can I catch correctly this exception? Have I try
to restore connection and after that return to execution? I've noticed
that after exception the WebService is not working anymore and I must
reinit it or smth?
I know that it's the common problem and there must be good patterns
for that.
Thanks in advance,
Tod