none
Windows Device Enrollment SyncML session doesn't proceed RRS feed

  • Question

  • I have done device enrollment process till WSTEP step successfully. But after the WSTEP the device starting to send SyncML and the first messege I get from the device is

    <?xml version="1.0" encoding="UTF-8"?>
    <SyncML xmlns="SYNCML:SYNCML1.2">
       <SyncHdr>
          <VerDTD>1.2</VerDTD>
          <VerProto>DM/1.2</VerProto>
          <SessionID>1</SessionID>
          <MsgID>1</MsgID>
          <Target>
             <LocURI>http://localhost:8000/handler.ashx</LocURI>
          </Target>
          <Source>
             <LocURI>0</LocURI>
          </Source>
       </SyncHdr>
       <SyncBody>
          <Alert>
             <CmdID>2</CmdID>
             <Data>0</Data>
          </Alert>
          <Replace>
             <CmdID>3</CmdID>
             <Item>
                <Source>
                   <LocURI>./DevInfo/DevId</LocURI>
                </Source>
                <Data>-477528224</Data>
             </Item>
             <Item>
                <Source>
                   <LocURI>./DevInfo/Man</LocURI>
                </Source>
                <Data>Microsoft Corporation</Data>
             </Item>
             <Item>
                <Source>
                   <LocURI>./DevInfo/Mod</LocURI>
                </Source>
                <Data>Microsoft Windows NT Workstation 6.3</Data>
             </Item>
             <Item>
                <Source>
                   <LocURI>./DevInfo/DmV</LocURI>
                </Source>
                <Data>1.2</Data>
             </Item>
             <Item>
                <Source>
                   <LocURI>./DevInfo/Lang</LocURI>
                </Source>
                <Data>en-US</Data>
             </Item>
          </Replace>
          <Final />
       </SyncBody>
    </SyncML>

    The problem is why I am getting target LocUri as http://localhost:8000/handler.ashx and source LocUri as 0. It should be syncml  end point url and device id right? And after sending response to the device with the get commands no further syncml messeges are communicated. what can cause for this and what can be do to correct it. Any help is very much appreciated.

    Thanks.

    Wednesday, March 11, 2015 4:44 PM

Answers

  • It looks like the MDM Client on the client side is failing to parse the SyncML XML content. When sending the above response from your server, can you please ensure that you:

    1.) Remove all the new line & carriage feed

    2.) Remove all extra spaces between the xml elements.

    In short, your server response should be sent as a single line without extra spaces and lines and should look something like this (based on the above):

    <SyncML xmlns="SYNCML:SYNCML1.2"><SyncHdr><VerDTD>1.2</VerDTD><VerProto>DM/1.2</VerProto><SessionID>1</SessionID><MsgID>1</MsgID><Target><LocURI>0</LocURI></Target><Source><LocURI>http://localhost:8000/handler.ashx</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>9</CmdID><Item><Target><LocURI>./cimv2/MDM_Client/MDM_Client.DeviceClientID=%220%22/DeviceClientID</LocURI></Target><Data>890ui</Data></Item></Replace><Get><CmdID>6</CmdID><Item><Target><LocURI>./cimv2/MDM_Client</LocURI></Target></Item></Get><Final/></SyncBody></SyncML>


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

    Monday, March 16, 2015 5:51 PM
    Moderator

All replies

  • The very first request from the MDM Agent to your server will have the LocURI as "0" for the Windows MDM implementation - because there is no "unique" device identifier for Windows. You will need to implement the device identification logic yourself using the MDM_ConfigSetting WMI Provider. The section “DM Agent configuration” in the protocol doc covers this (this setting is called DeviceClientId there).

    The Device ID is autogenerated to send in Pkg1 if it doesn’t exist and the server can then replace this setting through the WMI provider.

    The MDM Agent on windows will always respond with the http://localhost:8000/handler.ashx value, so that is expected.

    When you say that the MDM Agent sends the above request, your server sends back a response and then the MDM Agent stops after that, what does your server response look like?


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

    Saturday, March 14, 2015 1:03 AM
    Moderator
  • Hi Prashant,

    Thanks for the reply. I am sending following sync ml as the initial response from the server. 

    <?xml version="1.0" encoding="UTF-8"?>
    <SyncML xmlns="SYNCML:SYNCML1.2">
       <SyncHdr>
          <VerDTD>1.2</VerDTD>
          <VerProto>DM/1.2</VerProto>
          <SessionID>1</SessionID>
          <MsgID>1</MsgID>
          <Target>
             <LocURI>0</LocURI>
          </Target>
          <Source>
             <LocURI>http://localhost:8000/handler.ashx</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>9</CmdID>
             <Item>
                <LocURI>./cimv2/MDM_Client/MDM_Client.DeviceClientID=%220%22/DeviceClientID</LocURI>
                <Data>890ui</Data>
             </Item>
          </Replace>
          <Get>
             <CmdID>2</CmdID>
             <Item>
                <Target>
                   <LocURI>./cimv2/Win32_Processor</LocURI>
                </Target>
             </Item>
          </Get>
          <Final />
       </SyncBody>
    </SyncML>

    I have used replace command here to asking for the device id from next response from the device. 

    Saturday, March 14, 2015 3:31 AM
  • Hi Sameera,

    Have a look at this thread.

    https://social.msdn.microsoft.com/Forums/en-US/5dbc2db6-a3a4-44df-b5d3-b4bacae260d1/the-mdmclient-contacts-the-server-with-wrong-target-locuri?forum=developingmdmsolutions


    You are missing <Target> tag inside your replace command.


    Monday, March 16, 2015 1:14 AM
  • I have also tried it but didn't worked. The initial session terminates after the first syncml. 
    Monday, March 16, 2015 4:08 AM
  • Can you paste your complete request / response SyncML here..?
    Monday, March 16, 2015 6:51 AM
  • Hi infinitedreams,

    Thanks for your response.This is the initial syncml from device:

    <SyncML xmlns="SYNCML:SYNCML1.2">
       <SyncHdr>
          <VerDTD>1.2</VerDTD>
          <VerProto>DM/1.2</VerProto>
          <SessionID>1</SessionID>
          <MsgID>1</MsgID>
          <Target>
             <LocURI>http://localhost:8000/handler.ashx</LocURI>
          </Target>
          <Source>
             <LocURI>0</LocURI>
          </Source>
       </SyncHdr>
       <SyncBody>
          <Alert>
             <CmdID>2</CmdID>
             <Data>0</Data>
          </Alert>
          <Replace>
             <CmdID>3</CmdID>
             <Item>
                <Source>
                   <LocURI>./DevInfo/DevId</LocURI>
                </Source>
                <Data>-85824176</Data>
             </Item>
             <Item>
                <Source>
                   <LocURI>./DevInfo/Man</LocURI>
                </Source>
                <Data>Microsoft Corporation</Data>
             </Item>
             <Item>
                <Source>
                   <LocURI>./DevInfo/Mod</LocURI>
                </Source>
                <Data>Microsoft Windows NT Workstation 6.3</Data>
             </Item>
             <Item>
                <Source>
                   <LocURI>./DevInfo/DmV</LocURI>
                </Source>
                <Data>1.2</Data>
             </Item>
             <Item>
                <Source>
                   <LocURI>./DevInfo/Lang</LocURI>
                </Source>
                <Data>en-US</Data>
             </Item>
          </Replace>
          <Final />
       </SyncBody>
    </SyncML>

    This is what I send as the response:

    <SyncML xmlns="SYNCML:SYNCML1.2">
        <SyncHdr>
            <VerDTD>1.2</VerDTD>
            <VerProto>DM/1.2</VerProto>
            <SessionID>1</SessionID>
            <MsgID>1</MsgID>
            <Target>
                <LocURI>0</LocURI>
            </Target>
            <Source>
                <LocURI>http://localhost:8000/handler.ashx</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>9</CmdID>
                <Item>
                    <Target>
                        <LocURI>./cimv2/MDM_Client/MDM_Client.DeviceClientID=%220%22/DeviceClientID</LocURI>
                    </Target>
                    <Data>890ui</Data>
                </Item>
            </Replace>
            <Get>
                <CmdID>6</CmdID>
                <Item>
                    <Target>
                        <LocURI>./cimv2/MDM_Client</LocURI>
                    </Target>
                </Item>
            </Get>
            <Final/>
        </SyncBody>
    </SyncML>

    Thanks.

    Monday, March 16, 2015 9:02 AM
  • It looks like the MDM Client on the client side is failing to parse the SyncML XML content. When sending the above response from your server, can you please ensure that you:

    1.) Remove all the new line & carriage feed

    2.) Remove all extra spaces between the xml elements.

    In short, your server response should be sent as a single line without extra spaces and lines and should look something like this (based on the above):

    <SyncML xmlns="SYNCML:SYNCML1.2"><SyncHdr><VerDTD>1.2</VerDTD><VerProto>DM/1.2</VerProto><SessionID>1</SessionID><MsgID>1</MsgID><Target><LocURI>0</LocURI></Target><Source><LocURI>http://localhost:8000/handler.ashx</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>9</CmdID><Item><Target><LocURI>./cimv2/MDM_Client/MDM_Client.DeviceClientID=%220%22/DeviceClientID</LocURI></Target><Data>890ui</Data></Item></Replace><Get><CmdID>6</CmdID><Item><Target><LocURI>./cimv2/MDM_Client</LocURI></Target></Item></Get><Final/></SyncBody></SyncML>


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

    Monday, March 16, 2015 5:51 PM
    Moderator
  • Hi Prashant,

    Thanks for the answer. Yes it was the issue :).

    Monday, March 16, 2015 11:55 PM
  • Awesome, I am glad to hear that the issue was resolved!

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

    Tuesday, March 17, 2015 12:31 AM
    Moderator