Can't access a web service from Pocket PC 2002 emulator!

C

Carol W

Hi All,

I am trying my hand at writing client applications for
smart devices. I have managed a few steps but am stuck at
one place. Any help will be appreciated.
Here is the scenario.
I have a web service running on my machine. It runs fine
by itself.
Another .net project (smart device project) tries to use
the above web service but fails to find the remote server.

More...
a) I am not connected to the internet.
b) I can access the web service manually from the smart
device (by typing in the web service's url on the IE
browser of the emulator i.e.
http://169.254.25.129/MyWebService/Service1.asmx).
c) I have the 'Microsoft Loopback Adaptor' installed.

The web service is supposed to take in two integers and
return the sum. But when I click the Add button I get the
folowing error message on the emaulator screen.
----------------------------------------------------------
-------------------
A managed WebException occurred at Application::Run+0x1a

Unable to connect to the remote server

Application::Run+0x1a
Form1::Main+0xa

OK to terminate
----------------------------------------------------------
 
A

Alex Feinman [MVP]

Set a breakpoint where you create an instance of the web service. What is
the Url property set to?
 
C

Carol

Thanks for your reply!

Yes, the URL property is shown as
http://localhost/WebServ/MyWebService.asmx

I changed localhost to the IP address and it worked.

As this file Reference.cs is autogenerated, I wonder
where I set the URL in order that this file does not set
it as localhost.

Thanks again for the solution.

- Car
 
A

Alex Feinman [MVP]

The address in Reference.cs is generated from your entry in Add Web
Reference wizard. Unfortunately (and this is something we have complained
about in the past), when user chooses an option "Find Web Services on this
computer", the wizard uses localhost as the address, thus generating an
unusable proxy. You can either edit the url in Reference.cs, or set it
dynamically before invoking the service - the Url property is public
 

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