Smart Device App fails calling simple Web Service...

T

Terry Mulvany

I have a smart device application that cannot communicate with a web
service.
I am getting the following exception...

An unhandled exception of type 'System.Net.WebException' occurred in
System.Web.Services.dll
Additional information: Unable to connect to the remote server

I am running on XP Pro, VS.Net 2003. I have built a very basic Web Service
that returns a DataSet from a sql server stored proc using MS.AppBlock.Data.
Then I wrote a Web Form App that SUCCESSFULLY consumed the web service by
way of a datagrid on the form.

I then create a Smart Device App project, added a Web Reference to
http://localhost/<virt_dir>/<file>.asmx [the same web reference mind you
that succeeded in the web form app].
I am runnig the smart dev app thru (F5/debug) via deployment to the Pocket
PC 2002 emulator. When I put a breakpoint on the line that instantiates the
class in the web service it does not throw an exception only on the next
line where it tries to run the web method in this class that returns the
dataset.

[first line suceeds and second fails]
localhost.ScheduleWS s = new localhost.ScheduleWS();
dgMain.DataSource = s.GetWeeklySchedule();

NOTE: it does not have anything to do with setting the datagrid datasource
prop, because it throws the same exception when i just try to set a dataset
variable to the return of the web method.

any help would be greatly appreciated, thanks group.
 
C

casey chesnut

its is probably because your URL is using localhost.
the device or emulator thinks localhost is itself,
and not the machine where you are running the web service.
change that to be an IpAddress or MachineName.
Thanks,
casey
http://www.brains-N-brawn.com
 
T

Terry Mulvany

I thought about that and because I am running everything on the same machine
I tried the machine name (regulus) in place of localhost and that did not
wok.
So now I tried my local IP address (assigned by DHCP) which aliased my web
reference as just generic (WebReference) and that seemed to do the trick.
Thanks.

casey chesnut said:
its is probably because your URL is using localhost.
the device or emulator thinks localhost is itself,
and not the machine where you are running the web service.
change that to be an IpAddress or MachineName.
Thanks,
casey
http://www.brains-N-brawn.com


Terry Mulvany said:
I have a smart device application that cannot communicate with a web
service.
I am getting the following exception...

An unhandled exception of type 'System.Net.WebException' occurred in
System.Web.Services.dll
Additional information: Unable to connect to the remote server

I am running on XP Pro, VS.Net 2003. I have built a very basic Web Service
that returns a DataSet from a sql server stored proc using MS.AppBlock.Data.
Then I wrote a Web Form App that SUCCESSFULLY consumed the web service by
way of a datagrid on the form.

I then create a Smart Device App project, added a Web Reference to
http://localhost/<virt_dir>/<file>.asmx [the same web reference mind you
that succeeded in the web form app].
I am runnig the smart dev app thru (F5/debug) via deployment to the Pocket
PC 2002 emulator. When I put a breakpoint on the line that instantiates the
class in the web service it does not throw an exception only on the next
line where it tries to run the web method in this class that returns the
dataset.

[first line suceeds and second fails]
localhost.ScheduleWS s = new localhost.ScheduleWS();
dgMain.DataSource = s.GetWeeklySchedule();

NOTE: it does not have anything to do with setting the datagrid datasource
prop, because it throws the same exception when i just try to set a dataset
variable to the return of the web method.

any help would be greatly appreciated, thanks group.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top