GPRS & WebService best practices

  • Thread starter Thread starter Tod Johnson
  • Start date Start date
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 advise you that use asynchronous invoke. begin..xmethod and get result
with end.method if you has any king of problemn like cut connections your
invoke again until all process is ok.

you must be create a webreferent dinamic and create and destroy for each
use.

goodbye
 
Smart Client Offline App Block doesn't currently have a compact
framework implementation, though the concepts are valid for
PocketPC devices and you can code something similar yourself
with web services. I would strongly recommend studying the
Microsoft Mobile CRM case study for a GPRS situation like
yours. There was a webcast last week that may be available
for your to get on demand and there is extensive coverage of
the architecture in the October 2004 issue of .Net Developer's
Journal. The Nabisco case study on the Windows Mobile site is
also an example of a GPRS implementation using RDA and
SQL CE, not web services.

-Darren Shaffer
 
Tod said:
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

Go check out an article titled "Wireless Wire Protocols" over at
Devbuzz.com.

http://www.devbuzz.com/content/wireless_web_protocols_pg1.asp

Rob Tiffany, eMVP
 
Back
Top