locked
Getting Channel URI from OMA DM Agent (Windows 8.1) RRS feed

  • Question

  • Hello, 

    I have successfully registered client with a custom MDM service.

    Now, for push notification, I need to get Channel URI from the client device.

    To get it, I am sending this SyncML to client,

    <Get> 

    <CmdID>2</CmdID> 

    <Item> 

    <Target> 

    <LocURI> 

    ./cimv2/MDM_WNSConfiguration/MDM_WNSConfiguration.AppId=%22{AppId}%22/ConfigurationStatus 

    </LocURI> 

    </Target> 

    </Item> 

    </Get> 

    <Get> 

    <CmdID>3</CmdID> 

    <Item> 

    <Target> 

    <LocURI> 

    ./cimv2/MDM_WNSChannel/MDM_WNSChannel.AppId=%22{AppId}%22/Channel 

    </LocURI> 

    </Target> 

    </Item> 

    </Get> 

    <Get> 

    <CmdID>4</CmdID> 

    <Item> 

    <Target> 

    <LocURI> 

    ./cimv2/MDM_WNSChannel/MDM_WNSChannel.AppId=%22{AppId}%22/ChannelStatus 

    </LocURI> 

    </Target> 

    </Item> 

    </Get> 

    <Get> 

    <CmdID>5</CmdID> 

    <Item> 

    <Target> 

    <LocURI> 

    ./cimv2/MDM_WNSChannel/MDM_WNSChannel.AppId=%22{AppId}%22/ExpirationTime 

    </LocURI> 

    </Target> 

    </Item> 

    </Get> 

    But in return, it doesn't send ChannelURI and instead I am getting status 404. 

    How to diagnose this issue ?  

    Thank you.

    Tuesday, July 8, 2014 6:15 AM

Answers

  • Hi Biz_M,

    We will need to collect a MDM Trace from your Windows machine (the failing one, and most probably a working one too) to understand why the URI does not get updated. Can you please open a support case to troubleshoot this issue in more detail?

    Here are the steps:

    1.) Visit the URL: http://aka.ms/storesupport with your developer account. 

    2.) Under the "App Development" category, choose the "Building Apps" link. When the new page opens:

        a. Under the "Problem Type", choose "Developing an MDM solution"

        b. Then choose the appropriate "Category".

    3.) Once you do that, there should be an option that lets you “Start request”  which will let you open the support case.

    Thanks,

    Prashant


    Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog

    • Marked as answer by Biz_M Thursday, July 24, 2014 12:33 AM
    Thursday, July 10, 2014 6:35 PM

All replies

  • Are you actually passing in an AppId or are you just using the PlaceHolder value ({AppId})? Have you already sent the UpdateConfiguration command where the Data portion as well as the command string contains the actual {AppId} in the lowercase SID format (s-....)?

    For example, have you already sent this below command?

    If you have already sent the Exec command, then it will take some time to retrieve the WNS URI, so don't immediately try to Get after you Exec, instead try getting the URI during the next scheduled maintenance window/ sync.

    <Exec>
      <CmdID>{unique command id in message}</CmdID>
      <Item>
        <Target>
          <LocURI> ./cimv2/MDM_WNSConfiguration/MDM_WNSConfiguration.AppId=%22s-1-15-2-3219717196-666686559-712272758-1360859528-513151160-3699258166-1325108402%22/Exec=UpdateConfiguration
          </LocURI>
        </Target>
        <Meta>
          <Format xmlns="syncml:metinf">chr</Format>
          <Type xmlns="syncml:metinf">text/plain</Type>
        </Meta>
        <Data>ConfigString=s-1-15-2-3219717196-666686559-712272758-1360859528-513151160-3699258166-1325108402;15494windowsstorewns.wnsmdmpartner_skcpvdt8tnyse</Data>
      </Item>
    </Exec>
    


    Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog

    Tuesday, July 8, 2014 7:11 PM
  • Hi Prashant,

    Thank you for your reply.

    Yes, I am passing {AppId} token value properly.

    My steps are as follows :

    - Once device enrollment is done, I am sending Device Id and Configuration setting update to the device as per follows,

    <SyncML xmlns="SYNCML:SYNCML1.2"><SyncHdr><VerDTD>1.2</VerDTD><VerProto>DM/1.2</VerProto><SessionID>1</SessionID><MsgID>1</MsgID><Target><LocURI></LocURI></Target><Source><LocURI></LocURI></Source></SyncHdr><SyncBody><Status><CmdID>1</CmdID><MsgRef>1</MsgRef><CmdRef>0</CmdRef><Cmd>SyncHdr</Cmd><Data>200</Data></Status><Status><CmdID>2</CmdID><MsgRef>1</MsgRef><CmdRef>2</CmdRef><Cmd>Alert</Cmd><Data>200</Data></Status><Status><CmdID>3</CmdID><MsgRef>1</MsgRef><CmdRef>3</CmdRef><Cmd>Replace</Cmd><Data>200</Data></Status><Replace><CmdID>4</CmdID><Item><Target><LocURI>../cimv2/MDM_Client/MDM_Client.DeviceClientID=%220%22/DeviceClientID</LocURI></Target><Data>1c9ca308-5920-49e2-bb58-7a28df13acf9</Data></Item></Replace><Exec><CmdID>5</CmdID><Item><Target><LocURI>./cimv2/MDM_WNSConfiguration/MDM_WNSConfiguration.AppId=%22s-1-15-2-3861744795-1850508865-1642066403-1246437723-1412383695-1996856506-945443842%22/Exec=UpdateConfiguration</LocURI></Target><Meta><Format xmlns="syncml:metinf">chr</Format><Type xmlns="syncml:metinf">text/plain</Type></Meta><Data>ConfigString=s-1-15-2-3861744795-1850508865-1642066403-1246437723-1412383695-1996856506-945443842;3b20f80b.appname.jp_55fdxadhag1sj</Data></Item></Exec><Final/></SyncBody></SyncML>

    - After sending this command, I am asking for configuration status as follows,

    <SyncML xmlns="SYNCML:SYNCML1.2"><SyncHdr><VerDTD>1.2</VerDTD><VerProto>DM/1.2</VerProto><SessionID>1</SessionID><MsgID>2</MsgID><Target><LocURI></LocURI></Target><Source><LocURI></LocURI></Source></SyncHdr><SyncBody><Status><CmdID>1</CmdID><MsgRef>3</MsgRef><CmdRef>0</CmdRef><Cmd>SyncHdr</Cmd><Data>200</Data></Status><Get><CmdID>2</CmdID><Item><Target><LocURI>./cimv2/MDM_WNSConfiguration/MDM_WNSConfiguration.AppId=%22s-1-15-2-3861744795-1850508865-1642066403-1246437723-1412383695-1996856506-945443842%22/ConfigurationStatus</LocURI></Target></Item></Get><Get><CmdID>3</CmdID><Item><Target><LocURI>./cimv2/MDM_WNSChannel/MDM_WNSChannel.AppId=%22s-1-15-2-3861744795-1850508865-1642066403-1246437723-1412383695-1996856506-945443842%22/Channel</LocURI></Target></Item></Get><Get><CmdID>4</CmdID><Item><Target><LocURI>./cimv2/MDM_WNSChannel/MDM_WNSChannel.AppId=%22s-1-15-2-3861744795-1850508865-1642066403-1246437723-1412383695-1996856506-945443842%22/ChannelStatus</LocURI></Target></Item></Get><Get><CmdID>5</CmdID><Item><Target><LocURI>./cimv2/MDM_WNSChannel/MDM_WNSChannel.AppId=%22s-1-15-2-3861744795-1850508865-1642066403-1246437723-1412383695-1996856506-945443842%22/ExpirationTime</LocURI></Target></Item></Get><Final/></SyncBody></SyncML>

    I am sending this syncml 5 times in loop to receive the status , but I am not getting ChannelURI in any of the request. So , once server stops sending any request, then session will be terminated. And as server has no client ChannelURI, server can not send request afterwards. How do I force client to connect with server again to establish the session?


    • Edited by Biz_M Wednesday, July 9, 2014 12:48 AM
    Wednesday, July 9, 2014 12:43 AM
  • Hi Prashant,

    Here is my findings for this issue.

    - Case 1 On VM : I have Windows 8.1 Professional with Update 1 installed as a VirtualBox VM, and I was using it as a client machine.

    After sending configuring settings to this client,  after some time I checked if Channel URI is retrieved by client machine or not. And it had not, as per this screenshot.

    - Case 2 On Actual Device : I tried on actual Acer Windows 8.1 Tablet ( Update 1 not installed ),  it is getting Channel URI properly as follows,

    Could you check it and let me know if this issue occurs because of VM or is it Update 1 issue ?

    Thank you.

    Regards,



    • Edited by Biz_M Wednesday, July 9, 2014 3:16 AM
    Wednesday, July 9, 2014 3:06 AM
  • I don't think it is a problem with Update 1 or a Virtual Machine. The process of retrieving the WNS Channel URI is very much similar to calling the PushNotificationChannelManager.CreatePushNotificationChannelForApplication API to retrieve the Channel URI from WNS.

    On the faulty machine, can you check the following registry key and tell me what values do you see under it:

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\MDM

    In this case, the HKCU is the current user's registry hive of the user context from where you are trying to enroll.

    Do you see anything called; WNSChannelExpiryTime, WNSChannelLastError or WNSChannelUri?


    Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog

    Thursday, July 10, 2014 12:20 AM
  • Hi Prashant,

    Registry values are as follows,

    Windows Registry Editor Version 5.00

    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\MDM]
    "WNSChannelUri"=hex(2):00,00
    "WNSChannelExpiryTime"=hex(b):00,00,00,00,00,00,00,00
    "WNSChannelLastError"=dword:00000000


    Thursday, July 10, 2014 12:40 AM
  • There does not appear to be any error with retrieving the Channel URI, and it appears to be just initialized. How long does the registry value appear to be in this state? The WNS Channel URI will be checked for during the next maintenance window and get updated. When the maintenance task runs, the Sync with the server must succeed otherwise the MDM Channel URI will not be updated/ checked.

    Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog

    Thursday, July 10, 2014 1:12 AM
  • Hi Prashant,

    On actual device, it doesn't take long to retrieve Channel URI ( in number of seconds). But on VM , I waited for 4-5 hours and it didn't get any value at all. 

    Thursday, July 10, 2014 1:32 AM
  • Hi Biz_M,

    We will need to collect a MDM Trace from your Windows machine (the failing one, and most probably a working one too) to understand why the URI does not get updated. Can you please open a support case to troubleshoot this issue in more detail?

    Here are the steps:

    1.) Visit the URL: http://aka.ms/storesupport with your developer account. 

    2.) Under the "App Development" category, choose the "Building Apps" link. When the new page opens:

        a. Under the "Problem Type", choose "Developing an MDM solution"

        b. Then choose the appropriate "Category".

    3.) Once you do that, there should be an option that lets you “Start request”  which will let you open the support case.

    Thanks,

    Prashant


    Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog

    • Marked as answer by Biz_M Thursday, July 24, 2014 12:33 AM
    Thursday, July 10, 2014 6:35 PM
  • This issue has been resolved.

    Thank you.

    Thursday, July 24, 2014 12:34 AM
  • BIZ_M

    Can you tell me what your fix was for this? Thanks

    Wednesday, December 24, 2014 3:29 AM
  • BIZ_M

    Can you tell me what your fix was for this? Thanks

    Hi,

    Process, in which I was not getting WNS Channel :

     (1) Sending 

    Exec=UpdateConfiguration command to client.

    (2) Client sends  result

    <SyncHdr><VerDTD>1.2</VerDTD><VerProto>DM/1.2</VerProto><SessionID>1</SessionID><MsgID>2</MsgID><Target><LocURI>http://localhost:8000/handler.ashx</LocURI></Target><Source><LocURI>0</LocURI></Source></SyncHdr>......

    <Cmd>Exec</Cmd><Data>200</Data> .......

    back,

    (3) Server sends nothing and waits for client to contact back with WNS channel

    To get WNS channel thing working, 

    I changed step (3), instead of doing nothing, I had to send acknowledgement for SyncHdr which client sent.

    <SyncML xmlns="SYNCML:SYNCML1.2"><SyncHdr><VerDTD>1.2</VerDTD><VerProto>DM/1.2</VerProto><SessionID>1</SessionID><MsgID>2</MsgID><Target><LocURI>0</LocURI></Target><Source><LocURI>http://localhost:8000/handler.ashx</LocURI></Source></SyncHdr><SyncBody><Status><CmdID>1</CmdID><MsgRef>2</MsgRef><CmdRef>0</CmdRef><Cmd>SyncHdr</Cmd><Data>200</Data></Status><Final/></SyncBody></SyncML>

    Wednesday, December 24, 2014 3:47 AM