Associating an application with a connection in Connection Manager

Consider a scenario where a connection exposes some service to be used by a service-specific application, or collection of such applications. For example, consider some set of “Premium Services” that are used by an application allowing user to interact with these services. In Connection Manager (CM), there are two options in associating an application with a connection:

1. Association by connection name.   If the name of the connection is known, the application can ask for it explicitly using ConnMgrMapConRef(). The application can obtain the connection name by having the name configured in application.

2. Association by meta-network.   If the meta-network that the connection leads to is known, the application can ask for the meta-network by its GUID. The application can obtain the GUID by:

a. GUID configured in the application.

b. Name of meta-network, such as “Premium Services Network”, configured in application, and mapping the name of the meta-network to GUID using ConnMgrEnumDestinations().

The above approaches require that the service-specific connection is provisioned to lead to a custom destination meta-network that is unlikely to be requested by other applications. Custom networks can be created using CM_Networks configuration service provider. If a service-specific connection points to a well known network is, such as “The Internet” or “Work”, then CM may connect applications such as Mobile Internet Explorer (IE) over the connection even in the presence of other more appropriate connections. If the service-specific connection is not able to honor Mobile IE’s HTTP requests then this misconfiguration will lead to failures in many applications and a bad user experience.

Option 1 is simple to implement, but has limitations. First, since the application is specifically asking for the one connection, CM will be forced to use that connection by itself without any proxies that may be required to access the service. In this case, the application will need to be also configured with the proxy information. Second, if the service is accessible using more than one connection, then CM will not be able to select the best connection for the given moment, and the application will need to know about the different options and implement the selection logic.

The preferred option in associating an application to a connection is option 2, association by meta-network. Although this option requires more configuration, it is flexible and doesn’t have the limitations associated with the first option. For example, consider a Premium Service available as a custom network “Premium Service Network” and exposed by:

· A WiFi connection: PREMIUM à “Premium Services Network”

· Across a HTTP proxy over any connection connecting to the Internet: “The Internet” à Premium Services HTTP Proxy à “Premium Service Network”

With this configuration, an application wanting to access the Premium Service Network could find it in list of ConnMgrEnumDestinations and have CM choose the best connection for the application to connect. The XML configuration that supports this example follows.

<wap-provisioningdoc>

   <characteristic type="CM_Networks">

      <characteristic type="Premium Services Network">

         <parm name="DestId" value="{275abb2d-829f-420e-9533-256651e04a66}"/>

      </characteristic>

   </characteristic>

   <characteristic type="Wi-Fi">

      <characteristic type="access-point">

         <characteristic type="PREMIUM">

            <parm name="DestId" value="{275abb2d-829f-420e-9533-256651e04a66}"/>

         </characteristic>

      </characteristic>

   </characteristic>

   <characteristic type="CM_ProxyEntries">

      <characteristic type="Premium Services HTTP Proxy">

         <parm name="SrcId" value="{436EF144-B4FB-4863-A041-8F905A62C572}" />

         <parm name="DestId" value="{275abb2d-829f-420e-9533-256651e04a66}" />

         <parm name="Proxy" value="proxyservername:80" />

         <parm name="Type" value="1" />

      </characteristic>

   </characteristic>

</wap-provisioningdoc>

References:

· Meta-networks Configuration Service Provider @ http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mobilesdk5/html/wce51grfcm_proxyentriescsp.asp

· WiFi Configuration Service Provider @ http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mobilesdk5/html/wce51grfcm_proxyentriescsp.asp

· Proxy Configuration Service Provider @ http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mobilesdk5/html/wce51grfcm_proxyentriescsp.asp

 

[Author: Adam Dyba]