none
The MDMClient contacts the server with wrong Target LocUri. RRS feed

  • Question

  • The enrollment process completes successfully.

    But the management session to the server has the following syncML:

    <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>54356704</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-IN</Data>
          </Item>
        </Replace>
        <Final />
      </SyncBody>
    </SyncML>
    
    1. Why does the Target location uri point to some random handler.ashx and not the actual management server url passed in the device provisioning doc while enrollment ?
    2. Why does the Source in the SyncHdr point to 0 instead of the correct device ID ?
    3. Shouldnt it be same as the DevId which is present in the Replace command in the SyncBody ?

    Wednesday, November 5, 2014 1:38 PM

Answers

  • Hi Harishankar,

    It is a syntax error indeed. I figured it out, sorry it was my mistake. I missed one tag in my previous "Replace" command post.

    It should be as below (note  <Target> tag ), try this command.

    <Replace><CmdID>4</CmdID><Item><Target><LocURI>./cimv2/MDM_Client/MDM_Client.DeviceClientID=%220%22/DeviceClientID</LocURI></Target><Data>890ui</Data></Item></Replace>
    sorry my bad.



    • Edited by Biz_M Friday, November 14, 2014 1:04 AM
    • Marked as answer by Harishankar G Thursday, November 27, 2014 11:39 AM
    Friday, November 14, 2014 12:49 AM

All replies

  • Based on my experience,

    (1) Source / Target location uri, doesn't matter, what ever it comes with syncml. It doesn't affect anything, and we won't be using it anywhere. So, it is better to ignore.

    (2) Regarding device id, it comes as 0, until you set it. You have to set device id by sending replace command to 

    ./cimv2/MDM_Client/MDM_Client.DeviceID

    (3) According to protocol document,

    The DevId is unknown or invalid until the server sends the DevId to the client using a Replace command. The server should always identify the client by the subject name in the device identity certificate which is included in all HTTPS POST commands from the client to the server. 

    Better not to use DevId for identifying the device, instead use HTTPS post certificate which client sends back to server. 


    Thursday, November 6, 2014 7:24 AM
  • According to the protocol document the initial DM session will contain the Device ID in the LocUri of the Source tag.

    More over the URL also does not conform to the server url that is provided during the DeviceProvisioning is done.

    Is there a specific reason this works so or is there a loophole which would be fixed in the near future ?

    I also have a peculiar problem. When the PC contacts the MDM server for the first time i send the sample response provided in the protocol document with the get query for the MDM_Client.DeviceID.

    The response to this syncML is the same as the initiaition message. It does not contain any Results  at all and does not even include the status response for the respective Get Command.

    The SyncMl are attached for reference:

    Idle request from the Windows 8.1 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>-1697812448</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>


    Response sent: The response has first a Replace command to replace the Device ID and then fetch it. Note i also tried sending only the get command. That also doesnt work.

    <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>
        <Sequence>
          <CmdID>10</CmdID>
          <Replace>
            <CmdID>9</CmdID>
            <Item>
              <LocURI>./cimv2/MDM_Client/MDM_Client.DeviceID</LocURI>
              <Data>890ui</Data>
            </Item>
          </Replace>
          <Get>
            <CmdID>6</CmdID>
            <Item>
              <Target>
                <LocURI>./cimv2/MDM_Client</LocURI>
              </Target>
            </Item>
          </Get>
        </Sequence>
        <Final />
      </SyncBody>
    </SyncML>
    

    Response from the 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>-1697812448</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 above response should have a Results set with an item having the LocUri as ./cimv2/MDM_Client . But the expected behaviour is not seen.

    Please let me know if there could be any lapses in the configuration during enrollment itself ?

    But as far as the enrollment process is concerned it goes on smoothly with all authentication, 3rd party trusted certificate installations and the the WapProvisioningDoc being sent. The Enrollment UI on the device also acks the same and provides a link to the Store App uri.

    IF this has been already experienced by anyone please share your steps to overcome this problem wherein the server URl and the Device ID are not sent properly to the MDM server.

    Thursday, November 6, 2014 1:03 PM
  • This type of response means your commands had a syntax error that prevents the device from reading it. It then ignores this and contacts the server again for new commands. Your replace does not look correct I would start there.
    Thursday, November 6, 2014 5:33 PM
  • Hi Harishankar,

    Try this LocURI for your replace command : 

    ./cimv2/MDM_Client/MDM_Client.DeviceClientID=%220%22/DeviceClientID

    Something like,

    <Replace>
            <CmdID>9</CmdID>
            <Item>
              <LocURI>./cimv2/MDM_Client/MDM_Client.DeviceClientID=%220%22/DeviceClientID</LocURI>
              <Data>890ui</Data>
            </Item>
          </Replace>

    One more thing, I saw you are using <sequence> , I don't use that while sending commands, so I don't know if it affects the behavior or not.

    Friday, November 7, 2014 12:30 AM
  • Hii Biz_M,

    I tried using the above CSP .. But again it gives me the same response. It doesnt have any information on even the status response for the replace command that is sent. 

    I would also like to know whether the ./DevInfo/DevID is same as the unique id for the device. If so then why is it that the response has the DevId as some random number and the Source tag in the header shows the ID as 0. ?

    Thank you for your valuable time.

    Tuesday, November 11, 2014 6:36 AM
  • Hi Harishankar,

    That replace command should work. Can you paste, the command you are sending and response you are getting back, here ?

    • Edited by Biz_M Tuesday, November 11, 2014 6:51 AM
    Tuesday, November 11, 2014 6:49 AM
  • Hii Biz_M,

      Thank you for your patience in looking into the case.

      I am attaching the SyncML's that i have sent and the response i recevied:

    SyncML sent from Server to Windows 8.1 PC:

    <SyncML xmlns="\&quot;SYNCML:SYNCML1.2\&quot;">
      <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>
        <Sequence>
          <CmdID>10</CmdID>
          <Replace>
            <CmdID>9</CmdID>
            <Item>
              <LocURI>./cimv2/MDM_Client/MDM_Client.DeviceClientID=%220%22/DeviceClientID</LocURI>
              <Data>890ui</Data>
            </Item>
          </Replace>
          <Get>
            <CmdID>6</CmdID>
            <Item>
              <Target>
                <LocURI>./cimv2/MDM_Client</LocURI>
              </Target>
            </Item>
          </Get>
        </Sequence>
        <Final />
      </SyncBody>
    </SyncML>
    

    Response Received:

    <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>1264217520</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 above response does not give any status codes for the request sent. It doesnt even ACK the receipt of the command but i get a totally irrelevant message from the Device.

    Thank you once again for your patience Biz_M


    Thursday, November 13, 2014 4:13 AM
  • Hi Harishankar,

    Your SyncMl seems correct. Can you try removing sequence related tags ?

    <Sequence><CmdID>10</Sequence>

    One more thing, In your SyncML can you make,

    <SyncML xmlns="\&quot;SYNCML:SYNCML1.2\&quot;">

    to more look like, just in case.

    <SyncML xmlns="SYNCML:SYNCML1.2">


    • Edited by Biz_M Thursday, November 13, 2014 5:21 AM
    Thursday, November 13, 2014 5:13 AM
  • As far as the sequence is considered i first tried without them. They gave me the same response.

    And the quotes : it was copied from java into this site so the " were automatically converted to the html entity. The actual text goes with just " symbol and not \&quot;.

    The point is I am not worried that my command is not working. The thing that seems weird is that the status response does not contain any status code pertaining to the cmdID;s that are being sent.

    The response is standard not matter what. Even if the command is erroraneous the response should contain the error code in the status message for the corresponding ID. Isnt It ?

    Thursday, November 13, 2014 10:58 AM
  • As capt awesome had said,

    Device is again sending syncml with alert means, your commands had a syntax error that prevents the device from reading it. so device has just ignored the syncml you sent and it is sending back the alert. Apart from syntax error, other case is when SessionID or MsgID is not what was expected by the DM client then also this can happen.

    Thursday, November 13, 2014 1:00 PM
  • Hi Harishankar,

    It is a syntax error indeed. I figured it out, sorry it was my mistake. I missed one tag in my previous "Replace" command post.

    It should be as below (note  <Target> tag ), try this command.

    <Replace><CmdID>4</CmdID><Item><Target><LocURI>./cimv2/MDM_Client/MDM_Client.DeviceClientID=%220%22/DeviceClientID</LocURI></Target><Data>890ui</Data></Item></Replace>
    sorry my bad.



    • Edited by Biz_M Friday, November 14, 2014 1:04 AM
    • Marked as answer by Harishankar G Thursday, November 27, 2014 11:39 AM
    Friday, November 14, 2014 12:49 AM
  • Thanks Biz_M for the help and patience. :)
    Thursday, November 27, 2014 11:39 AM