Couldn't Access Webservice on localhost

K

Krishna

Hi All,

Here follows the scinario of my problem :

Step 1:
Created a sample webservice on the localhost with the name HelloWorld.
And the url to acccess this services is like this.
http://localhost/WSTest/HelloWorld.asmx

and it contains only one method mHelloWorld().. which returns "Hello World"
string.

Step 2:

Created a client application (Smart device application) that consumes the
above created service.

Using the Add Webreference from the Project toolbar.. added the service to
the client and created the necessary code to access it.

Step 3:

After successfull compilation and deployment in both emulator as well as in
Pocket Pc Device.. i got the following error.

An unhandled exception of type 'System.Net.WebException' occurred in
System.Web.Services.dll

Additional information: Unable to connect to the remote server

The configurations of the dev. env. as follows:

VS .NET 2003 Ent

Emulator: Pocket PC 2002

Device: iPAQ 3700 - Pocket PC v 3.0.11171..

Thanks.. in advance....

Regards,

Krishna. Akula
 
P

Peter Foot [MVP]

This is because whether your device is a separate physical device or a
"virtual" device in the case of the emulator it is not the same machine as
the desktop pc. localhost is used to reference the machine on which the
request is initiated - you need to replace this with the IP address or
machine name of the PC on which the webservice is hosted.


Peter
 
K

Krishna

Hi Peter,
Thanks for the reply and
I tried that too.
Changed to Machine Name as well as IP address. but no use.. :-(

Please let me know if there is any solution for this..

Regards,
Krishna Akula.
 
C

Chris Tacke, eMVP

This is asked a lot, so a search would have been a good first step.

"localhost" does *NOT* equate to "you dev PC". It means "The machine on
which I'm running". That means that to the Pocket PC, "localhost" is the
pocket pc itself, so it's trying to find the web service on it's own web
server, which is doesn't have, so it fails. NEVER, NEVER, EVER use
localhost. Use the machine name or IP.

-Chris
 
K

Krishna

Thanks Chris,

I made the necessary changes ... putting.. IP address and all..
The webservice working fine in emulator.. and the problem still getting from
the device(iPAQ) with the following error..

"Unable to read data from the transport connection"

how can i resolve it ??

awaiting.. for the solution...

Regards,
Krishna.Akula
 
Z

Zippy

is your development pc on a network or not?
my emulator will not "connect" to my pc when disconnected from out
network, but works when connected. I assume this is to do with DNS
resolution.

Andy
 
K

Kevin Daly

Your problem is probably in the first instance that you need to install the
loopback adapter so your PC can pretend to the emulator that it's on a
network.
There are instructions on how to do this here:
http://msdn.microsoft.com/library/d...l/pbtskInstallingMicrosoftLoopbackAdapter.asp
(For both Windows XP and Windows 2000).

Then you can type "ipconfig" in a command window, and use the value
displayed for "Ethernet adapter Local Area Connection" for your PC's IP
address.
Should work like a charm.
From there, to make life easier, I recommend Pocket Hosts by Marc Zimmermann
(http://www.zimac.de/cestuff.htm - Have a look. It just works).

On the other hand (and changing the subject completely without
justification, but it's been a frustrating week), getting an ad-hoc (as
opposed to infrastructure) WiFi link to work from a Pocket PC with a
DCF-660W card, *that's* the hard one (hint: I gave up).
 

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