1

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.

Community
  • 1
  • 1
Duy Le
  • 21
  • 7

2 Answers2

0

if "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." the httpwebrequest does not trigger the connection manager to connect to the right network type. There is a 'Work' and 'Internet' connection. What URL are you using for the webrequest? It is possibly pointing to a 'work' type address, one that uses a non-dotted scheme.

Try setting the connections on the device to be set both at 'Work' with the setting the 'Work' connection as one that also connects to the 'Internet' with no proxy. And then set the WiFi adapter to connect to 'work' too (see Settings>Connections>WiFi, "Network card connects to:=Work").

Setting to allow DMA for a real device in ActiveSync or Windows Mobile Device Manager makes no sense. This is for Emulator only. But 'Allow data connections" in WMDC is a must or the hardware device will switch off the WiFi connection when connected to ActiveSync.

josef
  • 5,951
  • 1
  • 13
  • 24
  • Thanks Josef, I tried your suggestion. I set both the Connections (Internet & Private) to "My Work Network" and set the this network connect to the internet without any proxy and set the Network card to Work also, but it still did not work. Also, the urls I have been testing were with dot scheme (http://www.google.com, http://192.168.1.2:80/) and without dot scheme (http://duyle-pc/). – Duy Le Oct 04 '16 at 09:31
  • I tried the P/Invoke ConnMgr methods such as ConnMgrMapUrl (always return 00000-000000 on the device, whereas on the emulator, it returns the correct Guid for the given Uri). Method ConnMgrEstablishConnectionSync yield the status "Connected" for any kind of URLs (google or local) and for both Internet Guid and Work Guid. So i guess the connection can be established). Also the method EstablishConnectionForURL actually yeilds result -2147483648 = 0x80000000 Hresult. Actually, code ran past the proxy and the service points stuffs before it encounters the error somewhere without any proofs. – Duy Le Oct 04 '16 at 09:40
  • Did you try the SAME URL in Internet Explorer on the device? Why do you bother with connection manager? It normally does it's work without the need to manage or control it. Possibly you can also add the code lines that you use for the httpWebrequest. For further analysis use tools like vxUtils and the MS Network Analyzer. – josef Oct 04 '16 at 11:00
0

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.

Duy Le
  • 21
  • 7