Accessing Webservices from Emulator

G

Guest

I am using the WinCE Emulator to investigate Webservices under Netcf. Though
I can access the Internet (e.g., www.msn.com) from inside the Emulator, so
far I have not been able to connect to a Webservice created using Vs2003. I
can ask this Webservice (that runs on the desktop) from a Browser on the
desktop but not from within the Emulator.

Is there a way to do this?

Are there special security settings for the web page?

Thanks
 
G

Ginny Caughey [MVP]

John,

What are you using for the address of the web service? Generally using an IP
address rather than a URL is more reliable for testing in the emulator
(which may not have access to a DNS service), and be sure not to use the
localhost address of the deskop machine.
 
J

John Socha-Leialoha

John said:
I am using the WinCE Emulator to investigate Webservices under Netcf. Though
I can access the Internet (e.g., www.msn.com) from inside the Emulator, so
far I have not been able to connect to a Webservice created using Vs2003. I
can ask this Webservice (that runs on the desktop) from a Browser on the
desktop but not from within the Emulator.

Is there a way to do this?

Are there special security settings for the web page?

Thanks

Have you tried using your computer's IP address instead of it's name?

-- John
 
G

Guest

Yes, but it did not solve the problem.

I finally got the Netcf App to connect to the desktop Webservice but I am
not sure why and if it will be reliable.

I went back to the Webservice solution on the desktop and created a new
Webservice and made it to run from the computer name ("CpLapJ3") rather then
"localhost" (which was the default).

Even after changing the localhost to CpLapJ3 and deleting the old
WebReference and adding the new one the Netcf App will still not run. When I
examined the auto-generated the files some references were still being made
to localhost even though the Webservice was set to use the CpLapJ3. I changed
those localhost references manually to CpLapJ3. Still that did not get the
Netcf App in the Emulator to connect to the desktop Webservice. Only after I
hit on running the Browser first on the Webservice (which did show the
Webservice). Somehow this did "kick start" the webservice and the Netcf did
work but I don't know why!

Also this intermittent behavour is of real concern. Do you have any ideas
why I am seeing this activity?

Thanks.
 
G

Guest

I did try the raw Ip address but it did not solve the problem.

I finally got the Netcf App to connect to the desktop Webservice but I am
not sure why and if it will be reliable.

I went back to the Webservice solution on the desktop and created a new
Webservice and made it to run from the computer name ("CpLapJ3") rather then
"localhost" (which was the default).

Even after changing the localhost to CpLapJ3 and deleting the old
WebReference and adding the new one the Netcf App will still not run. When I
examined the auto-generated the files some references were still being made
to localhost even though the Webservice was set to use the CpLapJ3. I changed
those localhost references manually to CpLapJ3. Still that did not get the
Netcf App in the Emulator to connect to the desktop Webservice. Only after I
hit on running the Browser first on the Webservice (which did show the
Webservice). Somehow this did "kick start" the webservice and the Netcf did
work but I don't know why!

Also this intermittent behavour is of real concern. Do you have any ideas
why I am seeing this activity?

Thanks.
--
John Olbert


Ginny Caughey said:
John,

What are you using for the address of the web service? Generally using an IP
address rather than a URL is more reliable for testing in the emulator
(which may not have access to a DNS service), and be sure not to use the
localhost address of the deskop machine.
 
N

n33470

John,

I think you've got it. The emulator needs to get a network
connection, and by running the browser from inside of the emulator
you've "kick-started" it. You might consider saving the state of the
emulator once you have a successful network connection.

--steve
 
J

John Socha-Leialoha

John said:
Yes, but it did not solve the problem.

I finally got the Netcf App to connect to the desktop Webservice but I am
not sure why and if it will be reliable.

I went back to the Webservice solution on the desktop and created a new
Webservice and made it to run from the computer name ("CpLapJ3") rather then
"localhost" (which was the default).

Even after changing the localhost to CpLapJ3 and deleting the old
WebReference and adding the new one the Netcf App will still not run. When I
examined the auto-generated the files some references were still being made
to localhost even though the Webservice was set to use the CpLapJ3. I changed
those localhost references manually to CpLapJ3. Still that did not get the
Netcf App in the Emulator to connect to the desktop Webservice. Only after I
hit on running the Browser first on the Webservice (which did show the
Webservice). Somehow this did "kick start" the webservice and the Netcf did
work but I don't know why!

Also this intermittent behavour is of real concern. Do you have any ideas
why I am seeing this activity?

Thanks.

I've found I have to change the web service support classes on the
Pocket PC to use the IP address rather than the name of the machine
before it will work.

When you add a reference to a web service inside Visual Studio, it uses
localhost because it sees that the web service is running on the same
computer as Visual Studio. However, your CF application won't be running
on the "same" computer because it will be running in a device (either
real or emulated). The device doesn't have a way to resolve either
localhost or the name of your computer, which is why you need to use the
IP address of your computer as the target address for you web service calls.

Hope that helps,
-- John
 
G

Guest

I will try that but I have one problem. The computer is on a small Lan and
gets its Ip from a Dns. The Lan is maintained by a LinkSys box so I will see
if there is a way to set it based on the Mac address of the computer.

Thanks.
 
J

John Socha-Leialoha

I will try that but I have one problem. The computer is on a small Lan and
gets its Ip from a Dns. The Lan is maintained by a LinkSys box so I will see
if there is a way to set it based on the Mac address of the computer.

Thanks.

I have the same setup here and it works fine. Just run "ipconfig /all"
from the command line to find out your current IP address and use that.

The Lynksys boxes usually assign the same IP address to each computer
when the computer renews it's lease from the DHCP server, so your
computer's IP address probably won't change even if you don't make it a
static IP address.

-- John
 

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