TCP/IP transport via ActiveSync?
I currently have my WM5 device hooked up to desktop PC via ActiveSync 4.1. The device is set up so that I can surf the internet using PIE.
I have an HTTP server (implemented with HTTP listerner) running on the desktop PC, waiting for requests from a client app running on the device (using HttpWebRequest).
Without WiFi switched on, the client app on the device cannot access the HTTP server. Pinging desktop PC also does not work
However, when I switch the Wifi on, the client app on the device can access the HTTP server (via WiFi). Pinging desktop PC also works.
Is it possible to access the desktop PC via ActiveSync instead of WiFi?
Thanks
IF I understand correctly, you wish to access the internet via activesync from the mobile device? if you, you need to create a pass through connection from your mobile data connections settings
No, I simply mentioned that I could access the internet to confirm that the TCP/IP access through ActiveSync is configured properly. My goal is to access the HTTP server on the desktop PC from the PDA client application without having to use WiFi.
I want to access the HTTP server only using cradle with ActiveSync.
How do you create the passthrough connection?
hmmm. You want to access the HTTP Server (IIS site) on the PC from the pda?
You can do this, you need to basically know the IP of the http server, just like you browse the site locally on the PC (http://localhost/someDir)., so from the device it would become http://your-server-ip/someDir
To create a pass through connection, it will be somewhere in the data connection settings of your mobile device, but be sure you have activesync'd it when setting the option
Well, IIS is not running on the desktop machine, but an HttpListener is. When I just have ActiveSync, my client will not connect. With Wifi, it works.
The client app does a HTTP Post as follows:
Request = HttpWebRequest.Create(URI);
Request.Method = "POST";
Request.ContentType = "text/xml";
Request.ContentLength = ARequestText.Length;
etc..
First of all, with WM5 and ActiveSync 4.X you don't need to explicitly establish a passthrough connection; it should "just work". How does it work though?
When you cradle your device, you should find a new IP address on the Desktop computer connected to the device, which you can obtain through the command "ipconfig":
Ethernet adapter Local Area Connection 9:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 169.254.2.2
Subnet Mask . . . . . . . . . . . : 255.255.255.0
IP Address. . . . . . . . . . . . : fe80::8200:60ff:fe0f:e800%13
Default Gateway . . . . . . . . . :
The device actually will obtain an IP address as well, which is usually 169.254.2.1. So now, when you want to connect to the Desktop's HttpListener, you would make a HttpWebRequest with the url being http://169.254.2.2:12345 assuming your HttpListener listens on port 12345.
Note: Remember to make an exception for the port in firewall settings, if you are using Windows XP.
Cheers,
Anthony Wong [MSFT]
Thanks for the replyu Anthony. I will try this. How can this be done with PPC2003SE?
Anthony, thanks for the feedback. What I succeeded in doing is the following:
With the HttpListener, listen on 169.254.2.2:port.
Then issue a WebRequest from the WM5 PDA to URL 169.254.2.2:port. This gave the desired results and I could exchange data between the PDA client app and the HttpListener. Now I have the following question:
If my HttpListener is somewhere else on the network and not on the PC the PDA is connected to, how do I do this? I tried bridging the two connections and then connecting to the PC IP address instead (e.g. 10.0.0.101), but this did not work.
Hope you can help as this is really a stumbling block.
Thanks in advance
I have found by experiment that nothing is for free around here!
You must specify the Default Gateway for the Remote-NDIS Host Network Adapter on your device, to be the address of your PC - ie 169.254.2.2. If you find that the R-NDIS adapter is set for DHCP, then set it explicitly to 169.254.2.1 to allow you to set the Gateway. You might want to specify your work DNS server at the same time.
Then you need to set your PC up for IP forwarding - usual registry setting HKLM\system\currentcontrolset\services\tcpip\parameters\IPEnableRouter = 1
Then you need to provide routing info for your http listener machine to get stuff for 169.254.2.1 back to your PC.
The set now works, maybe.
Does anyone know how to consistently set the device address to something other than 169.254.2.1 ? I tried setting it to .3 instead, and it behaved like that up to the point where my appn used an UDPClient to send to a server and the sending address was .1 again. A real problem for two developers, two devices, one server!!
Bill