locked
How to configurate the xml file for ConfigurationManager? RRS feed

  • Question

  • Hi,
    I'm using the ConfigurationManager.TestConfiguration function in the Microsoft.WindowsMobile.Configuration name space, and i tried to pass this xml file:
    and the function returned me the other xml file. Does anybody know, what is wrong?

    <?xml version="1.0" encoding="utf-8" ?>
    <wap-provisioningdoc>
      
      <characteristic type="CM_Networks">
        <characteristic type="NETWORK">
          <parm name="DestId" value="{436EF144-B4FB-4863-A041-8F905A62C572}"/>
        </characteristic>
      </characteristic>
    
      <characteristic type="CM_GPRSEntries">
         <characteristic type="cel">
          <parm name="DestId" value="{436EF144-B4FB-4863-A041-8F905A62C572}" />
          <parm name="Enabled" value="1" />
          <parm name="UserName" value="gprs" />
          <parm name="Password" value="gprs2009" />
          <parm name="Domain" value="" />
          <parm name="SpecificIpAddr" value="0" />
          <parm name="IpAddr" value="" />
          <parm name="SpecificNameServers" value="0" />
          <parm name="DnsAddr" value="" />
          <parm name="AltDnsAddr" value="" />
          <parm name="WinsAddr" value="" />
          <parm name="AltWinsAddr" value="" />
          <characteristic type="DevSpecificCellular">
            <parm name="BearerInfoValid" value="1" />
            <parm name="GPRSInfoValid" value="1" />
            <parm name="GPRSInfoProtocolType" value="2" />
            <parm name="GPRSInfoL2ProtocolType" value="PPP" />
            <parm name="GPRSInfoAccessPointName" value="internet.iservice.com" />
            <parm name="GPRSInfoAddress" value="" />
            <parm name="GPRSInfoDataCompression" value="1" />
            <parm name="GPRSInfoHeaderCompression" value="1" />
            <parm name="GPRSInfoParameters" value="" />
          </characteristic>
        </characteristic>
      </characteristic>
    </wap-provisioningdoc>
    The xml file returned:

    <?xml version="1.0" ?> 
    - <wap-provisioningdoc>
    - <characteristic type="CM_Networks">
    - <characteristic type="NETWORK">
      <parm name="DestId" value="{436EF144-B4FB-4863-A041-8F905A62C572}" datatype="string" rw-access="3" /> 
      </characteristic>
      </characteristic>
    - <characteristic type="CM_GPRSEntries">
    - <characteristic type="cel">
      <parm name="DestId" value="{436EF144-B4FB-4863-A041-8F905A62C572}" options="My company name{DC449D35-B35D-E1A6-E493-361CADFD41A5}My Work Network{18AD9FBD-F716-ACB6-FD8A-1965DB95B814}My ISP{ADB0B001-10B5-3F39-27C6-9742E785FCD4}Work{A1182988-0D73-439E-87AD-2A5B369F808B}Secure WAP Network{F28D1F74-72BE-4394-A4A7-4E296219390C}The WAP Network{7022E968-5A97-4051-BC1C-C578E2FBA5D9}The Internet{436EF144-B4FB-4863-A041-8F905A62C572}" datatype="string" rw-access="3" /> 
      <parm name="Enabled" value="1" datatype="boolean" rw-access="3" /> 
      <parm name="UserName" value="gprs" datatype="string" rw-access="3" /> 
      <parm name="Password" value="gprs2009" datatype="string" rw-access="3" /> 
      <parm name="Domain" value="" datatype="string" rw-access="3" /> 
      <parm name="SpecificIpAddr" value="0" datatype="string" rw-access="3" /> 
      <parm name="IpAddr" value="" datatype="string" rw-access="3" /> 
      <parm name="SpecificNameServers" value="0" datatype="string" rw-access="3" /> 
      <parm name="DnsAddr" value="" datatype="string" rw-access="3" /> 
      <parm name="AltDnsAddr" value="" datatype="string" rw-access="3" /> 
      <parm name="WinsAddr" value="" datatype="string" rw-access="3" /> 
      <parm name="AltWinsAddr" value="" datatype="string" rw-access="3" /> 
    - <characteristic type="DevSpecificCellular">
      <parm name="BearerInfoValid" value="1" datatype="boolean" rw-access="3" /> 
      <parm name="GPRSInfoValid" value="1" datatype="boolean" rw-access="3" /> 
      <parm name="GPRSInfoProtocolType" value="2" datatype="integer" rw-access="3" /> 
      <parm name="GPRSInfoL2ProtocolType" value="PPP" datatype="integer" rw-access="3" /> 
      <parm name="GPRSInfoAccessPointName" value="internet.iservice.com" datatype="string" rw-access="3" /> 
      <parm name="GPRSInfoAddress" value="" datatype="string" rw-access="3" /> 
      <parm name="GPRSInfoDataCompression" value="1" datatype="boolean" rw-access="3" /> 
      <parm name="GPRSInfoHeaderCompression" value="1" datatype="boolean" rw-access="3" /> 
      <parm name="GPRSInfoParameters" value="" datatype="string" rw-access="3" /> 
      </characteristic>
      </characteristic>
      </characteristic>
      </wap-provisioningdoc>

    I hope somebody could help me, kind regards

    Sunday, May 24, 2009 12:36 AM

Answers

All replies

  • Hi,

    Are you trying to configure your device using the first piece of XML? When configuring a device, the XML that is passed to the configuration manager is normally returned. I am not sure why you would be getting the additional information however they are in effect the same pieces of XML.

    Does the configuration work using the first peice of XML?

    Hope this helps.

    Paul Diston
    http://www.smartmobiledevice.co.uk/
    Sunday, May 24, 2009 8:13 AM
  • Hi Paul:

    Let me rephrase my question.

    Objective: I'm trying to setup a GPRS internet connection programmatically on a portable device so applications may access internet. My app sould create, configure, connect and read status of this connection.

    Platform:

    OS:
         Windows Mobile 6 Professional
         Framework:
         .Net Compact Framework 2.0 and 3.5

    Terminal:
         Brand=Honeywell, Model=Dolphin 7600 Mobile Computer

    Hardware:
         CPU Samsung 2440 400 MHz
         Memory 64MB RAM X 128MB Flash 
         Bluetooth Class 2, version 1.2
         WLAN 802.11b/g
         GPRS radio

    Tool:   I'm using the ConnectionManager API contained in the “CellCore.dll” http://msdn.microsoft.com/en-us/library/bb840031.aspx sample code in http://msdn.microsoft.com/en-us/library/bb737297.aspx

    Results so far:
    1)I could setup the GPRS connection manually, establish the connection and read status.

    2)In order to setup the connection programatically I used ConfigurationManager. ProcessConfiguration with the next XML file:

    <?xml version="1.0" encoding="utf-8" ?>
    <wap-provisioningdoc>
    <characteristic type="CM_GPRSEntries">
        <characteristic type="GPRS1">
          <parm name="DestId" value="{436EF144-B4FB-4863-A041-8F905A62C572}" />
          <parm name="UserName" value="gprs" />
          <parm name="Password" value="gprs2009" />
          <parm name="Domain" value="" />
          <characteristic type="DevSpecificCellular">
             <parm name="GPRSInfoValid" value="1" />
             <parm name="GPRSInfoAccessPointName" value="internet.iservice.com" />
          </characteristic>
        </characteristic>
    </characteristic>
    </wap-provisioningdoc>

    2.a) Executing the the code in the Professional Emulator Mobile it creates the connection:
    The emulator has no phone attached therefore this connection can not be tested.

    2.b) Executing the code in the portable device the connection does not get created at all. 

    3) Given 2.b I used the ConnectionManager.TestConfiguration in the portable device to test the XML, it returned the next:

    <?xml version="1.0" ?> 
    - <wap-provisioningdoc>
    - <characteristic type="CM_GPRSEntries">
    - <characteristic type="cel">
      <parm name="DestId" value="{436EF144-B4FB-4863-A041-8F905A62C572}" options="??My company name?{DC449D35-B35D-E1A6-E493-361CADFD41A5}?My Work Network?{18AD9FBD-F716-ACB6-FD8A-1965DB95B814}?My ISP?{ADB0B001-10B5-3F39-27C6-9742E785FCD4}?Work?{A1182988-0D73-439E-87AD-2A5B369F808B}?Secure WAP Network?{F28D1F74-72BE-4394-A4A7-4E296219390C}?The WAP Network?{7022E968-5A97-4051-BC1C-C578E2FBA5D9}?The Internet?{436EF144-B4FB-4863-A041-8F905A62C572}?" datatype="string" rw-access="3" /> 
      <parm name="Enabled" value="1" datatype="boolean" rw-access="3" /> 
      <parm name="UserName" value="gprs" datatype="string" rw-access="3" /> 
      <parm name="Password" value="gprs2009" datatype="string" rw-access="3" /> 
      <parm name="Domain" value="" datatype="string" rw-access="3" /> 
      <parm name="SpecificIpAddr" value="0" datatype="string" rw-access="3" /> 
      <parm name="IpAddr" value="" datatype="string" rw-access="3" /> 
      <parm name="SpecificNameServers" value="0" datatype="string" rw-access="3" /> 
      <parm name="DnsAddr" value="" datatype="string" rw-access="3" /> 
      <parm name="AltDnsAddr" value="" datatype="string" rw-access="3" /> 
      <parm name="WinsAddr" value="" datatype="string" rw-access="3" /> 
      <parm name="AltWinsAddr" value="" datatype="string" rw-access="3" /> 
    - <characteristic type="DevSpecificCellular">
      <parm name="BearerInfoValid" value="1" datatype="boolean" rw-access="3" /> 
      <parm name="GPRSInfoValid" value="1" datatype="boolean" rw-access="3" /> 
      <parm name="GPRSInfoProtocolType" value="2" datatype="integer" rw-access="3" /> 
      <parm name="GPRSInfoL2ProtocolType" value="PPP" datatype="integer" rw-access="3" /> 
      <parm name="GPRSInfoAccessPointName" value="internet.iservice.com" datatype="string" rw-access="3" /> 
      <parm name="GPRSInfoAddress" value="" datatype="string" rw-access="3" /> 
      <parm name="GPRSInfoDataCompression" value="1" datatype="boolean" rw-access="3" /> 
      <parm name="GPRSInfoHeaderCompression" value="1" datatype="boolean" rw-access="3" /> 
      <parm name="GPRSInfoParameters" value="" datatype="string" rw-access="3" /> 
      </characteristic>
      </characteristic>
      </characteristic>
      </wap-provisioningdoc>
    

    I do not understand what this result is trying to tell me, specially the next part:

    <parm name="DestId" value="{436EF144-B4FB-4863-A041-8F905A62C572}"
       options="??My company name?{DC449D35-B35D-E1A6-E493-361CADFD41A5}?
       My Work Network?{18AD9FBD-F716-ACB6-FD8A-1965DB95B814}? 
       My ISP?{ADB0B001-10B5-3F39-27C6-9742E785FCD4}?
       Work?{A1182988-0D73-439E-87AD-2A5B369F808B}?
      Secure WAP Network?{F28D1F74-72BE-4394-A4A7-4E296219390C}?
      The WAP Network?{7022E968-5A97-4051-BC1C-C578E2FBA5D9}?
      The Internet?{436EF144-B4FB-4863-A041-8F905A62C572}?" datatype="string" rw-access="3" />

    Do I need to use one of this options?
    Do I have an error in my XML?
    Am I missing parameters?
    Why the connection does not get created in the physical device and ot does in the emulator?

    NOTE:
    I noticed that when the connection is setup manually it goes like:
    Add new modem connection/ConnectionName and ModemType/APN/User,Pwd,Domain.
    I could not relate any xml field to the ConnectionName.

    Thank you in advance for your help.


     

    Monday, May 25, 2009 9:59 PM
  • Hi Paul,

    I hope you could take a look my last replay "Monday, May 25, 2009 9:59 PM"  about how to configurate the ConfigurationManager using a xml file.

    Hope you could help me.

    Kind regards.
    Monday, June 15, 2009 7:26 PM
    • Marked as answer by Dante Rivera Tuesday, June 23, 2009 4:43 AM
    Tuesday, June 16, 2009 6:18 AM