windows-mobile-6.5internet-connection.net-cf-3.5webexceptionintermec

HttpWebRequest throws ConnectFailure on the real device but not on emulator for Windows Handheld 6.5


I'm having similar issues to this link No Internet on the device via code

I am working on the Intermec iRoc Ci70 device which is running on Windows Handheld Embedded 6.5. This device has the 802.11abgn Wireless LAN adapter.

On the device emulators running Windows Mobile 6.5.3, the HttpWebRequests are doing just fine but ARE NOT on the device. I always get the WebException with ConnectFailure status code on the device.

I tried to debug further down into the Native codes of ConnMgr class and found out that ConnMgrMapURL cannot map the URL to any network Dest Guid, it always returns 00000000-0000-0000-0000-000000000000. Further debugging shows me that the error which ConnectFailure exception occurs is in the method EstablishConnectionForURL in the mscoree.dll. Unfortunately, I cannot debug this file due to restrictions of the device.

I also tried OpenNETCF ConnectionManager class to do the connection. The status is connected, but looking at the codes of this class, OpenNETCF guys were doing hardcode Internet Guid id into the methods. But the the HttpWebRequest is still not getting the response.

I also turned off all securities as well as installed on SDK development certificates on the device.

I also tried to let the device use DMA via ActiveSync to connect to the internet and turned off WiFi as another test.

I also tried to target .NET-CF version 1, 2, 3.5 (3.5.9xxx) and 3.5 (3.5.7xxx)

None of the things I tried work. But the built-in browse and the Intermec HTML5 Browser (3rd party app) can connect to the internet and the local addresses.

Unfortunately, I do not have another device to compare. Please help me on this.


Solution

  • Thanks Josef for your help. I tried everything from setting the connections & network cards to editing the registries and using tools like MS Network Analyzer.

    It still gave the same results. It turned out that the ConnMgr's native methods did gave me the clues and solutions :-).

    As I mentioned the ConnMgr.ConnMgrMapURL always return 0000-0000000-00000 for any kind of URLs I tested. This issue led me to finding about the CM_Mappings Service Provider and the provisioning system the Windows Mobile provides Microsoft CM Mappings Definition.

    I followed this link Device Provisioning Tutorial to first use the RapidConfig tool to query the current CM_Mappings from the device and the result is ... nothing there. The emulator has and I tried to remove all entries off from the emulator and the result was that the emulator was the same as the device with the message ConnectFailure.

    So I used the default values found in the above links and pushed them back to the device and VOILA!!!. It worked and all the kinds of URL were routed correctly to the MetaNetworks and the HttpWebRequest did give the response code 200.

    It was one hell of an adventure there. I do not know why my device got these mappings erased and it is very frustrating on how MS implements their error handling. No helpful info found when these errors occurred. It took me nearly a week just to narrow down the root cause.

    I hope this will help someone who has the same issue.