locked
windows phone 8.1 mdm oma dm provider from device never sends back response for csp RRS feed

  • Question

  • Hi Guys,

    I have been trying to enroll a device and after few tries got this working. Now the problem is device is not sending any response to csp which was sent when management url is hit by device after enrollment. for testing i am using csp to lock device. 

    my mgmt service is java webservice and upon receiving request on mgmt url i am sending down the csp.

    do i need to have actual session for thas? m confused.

    shouldn't device be calling the the mgmt service again to swnd the response. I tried getting logs but could not find any errors in log only logs were there showing device could parse synchdr and syncbody. I got status 500 for synchdr though in first management call to my webservice and then keep on receiving this after hitting refresh button manually.

    any idea what is going wrong?

    Wednesday, July 30, 2014 6:41 PM

Answers

  • You need to acknowledge the credentials from the device using a Status command with result 212 in your response body.  Something like:

    <Status> 
      <MsgRef>1</MsgRef>
      <CmdRef>0</CmdRef> 
      <Cmd>SyncHdr</Cmd> 
      <CmdID>1</CmdID> 
      <TargetRef>https://enterpriseenrollment.test.com/Devicemanagement/managementservice.svc</TargetRef> 
      <SourceRef>urn:uuid:56722F8D-49D4-50EE-941E-A6CA9C316611</SourceRef> 
      <Data>212</Data> 
    </Status> 
    Similarly, you also need to respond with Status '200' (success) for each of the other commands sent by the client.


    Eric Fleck, Windows Store and Windows Phone Developer Support. If you would like to provide feedback or suggestions for future improvements to the Windows Phone SDK please go to http://wpdev.uservoice.com/ where you can post your suggestions and/or cast your votes for existing suggestions.


    • Edited by Eric Fleck Thursday, July 31, 2014 3:26 PM correct gramatical ambiguity
    • Marked as answer by winvil Friday, August 1, 2014 1:33 PM
    Thursday, July 31, 2014 3:24 PM

All replies

  • If you get no response after the first session message this means that your response was incorrectly formatted or contained invalid data.

    Can you post a sample of the SyncML your server received and the SyncML it sent in response?

    Note that there are two possible SyncML payload formats: xml and wbxml (WAP Binary XML).  You specify which format your server uses during enrollment in the "DEFAULTENCODING" node of the w7 APPLICATION characteristic.

    The OMA DM and SyncML protocols are defined by the Open Mobile Alliance (OMA) organization.  (http://openmobilealliance.org ) Make sure you read and understand the appropriate OMA specifications which are referenced by the Windows Phone 8.1 MDM protocol documentation.


    Eric Fleck, Windows Store and Windows Phone Developer Support. If you would like to provide feedback or suggestions for future improvements to the Windows Phone SDK please go to http://wpdev.uservoice.com/ where you can post your suggestions and/or cast your votes for existing suggestions.

    Wednesday, July 30, 2014 9:28 PM
  • Hi Eric.. 

    This is the SyncML I received from phone after hitting refresh button for the first time.

    <SyncML xmlns="SYNCML:SYNCML1.2">
      <SyncHdr>
        <VerDTD>1.2</VerDTD>
        <VerProto>DM/1.2</VerProto>
        <SessionID>1</SessionID>
        <MsgID>1</MsgID>
        <Target>
          <LocURI>https://enterpriseenrollment.test.com/Devicemanagement/managementservice.svc</LocURI>
        </Target>
        <Source>
          <LocURI>urn:uuid:56722F8D-49D4-50EE-941E-A6CA9C316611</LocURI>
        </Source>
        <Cred>
          <Meta>
            <Format xmlns="syncml:metinf">b64</Format>
            <Type xmlns="syncml:metinf">syncml:auth-basic</Type>
          </Meta>
          <Data>dGVzdGNsaWVudDoxMjM0NQ==</Data>
        </Cred>
      </SyncHdr>
      <SyncBody>
        <Alert>
          <CmdID>2</CmdID>
          <Data>1201</Data>
        </Alert>
        <Replace>
          <CmdID>3</CmdID>
          <Item>
            <Source>
              <LocURI>./DevInfo/DevId</LocURI>
            </Source>
            <Data>urn:uuid:56722F8D-49D4-50EE-941E-A6CA9C316611</Data>
          </Item>
          <Item>
            <Source>
              <LocURI>./DevInfo/Man</LocURI>
            </Source>
            <Data>NOKIA</Data>
          </Item>
          <Item>
            <Source>
              <LocURI>./DevInfo/Mod</LocURI>
            </Source>
            <Data>Lumia 630</Data>
          </Item>
          <Item>
            <Source>
              <LocURI>./DevInfo/DmV</LocURI>
            </Source>
            <Data>1.3</Data>
          </Item>
          <Item>
            <Source>
              <LocURI>./DevInfo/Lang</LocURI>
            </Source>
            <Data>en-US</Data>
          </Item>
        </Replace>
        <Final/>
      </SyncBody>
    </SyncML>


    I was getting this error  when when sessionid was mismatching. I got this working by observing mdm logs.. with alert 1223 for session abort

       

     <Status>
          <CmdID>1</CmdID>
          <MsgRef>1</MsgRef>
          <CmdRef>0</CmdRef>
          <Cmd>SyncHdr</Cmd>
          <Data>500</Data>
        </Status>

    after making changes server responded to this request with httpstatus 200 with content-lengh and header as application/vnd.syncml.dm+xml and payload is

    <SyncML xmlns="SYNCML:SYNCML1.2">
      <SyncHdr>
        <VerDTD>1.2</VerDTD>
        <VerProto>DM/1.2</VerProto>
        <SessionID>40</SessionID>
        <MsgID>1</MsgID>
        <Target>
          <LocURI>urn:uuid:56722F8D-49D4-50EE-941E-A6CA9C316611</LocURI>
        </Target>
        <Source>
       <LocURI>https://enterpriseenrollment.test.com/Devicemanagement/managementservice.svc</LocURI>
        </Source>
      </SyncHdr>
      <SyncBody>
        <Exec>
          <CmdID>23</CmdID>
          <Item>
            <Target>
              <LocURI>
                            ./Vendor/MSFT/RemoteLock/Lock
                        </LocURI>
            </Target>
          </Item>
        </Exec>
      </SyncBody>
    </SyncML>


    After correcting my payloads still device is still not responding with execution status and there are no error logs. From logs I can say device DM provider is able to parse synchdr and syncbody

    Here are the logs :

    1. omadmclient.exe (3048), Microsoft-WindowsPhone-OmaDm-Client-Provider//, Attempting to find referenced cert

    2.  omadmclient.exe (3048), Microsoft-WindowsPhone-OmaDm-Client-Provider//, Referenced cert not found (which is OK).

    3.omadmclient.exe (3048), Microsoft-WindowsPhone-OmaDm-Client-Provider//, Server returned success HTTP status code (200)

    4.omadmclient.exe (3048), Microsoft-WindowsPhone-OmaDm-Client-Provider//, Package successfully sent

    5.omadmclient.exe (3048), Microsoft-WindowsPhone-OmaDm-Client-Provider//, Successfully parsed server's SyncHdr

    6.omadmclient.exe (3048), Microsoft-WindowsPhone-OmaDm-Client-Provider//, Successfully parsed server's SyncBody

    PS: I can see device getting locked but no response from device about command status :(





    • Edited by winvil Thursday, July 31, 2014 9:45 AM
    Thursday, July 31, 2014 8:55 AM
  • You need to acknowledge the credentials from the device using a Status command with result 212 in your response body.  Something like:

    <Status> 
      <MsgRef>1</MsgRef>
      <CmdRef>0</CmdRef> 
      <Cmd>SyncHdr</Cmd> 
      <CmdID>1</CmdID> 
      <TargetRef>https://enterpriseenrollment.test.com/Devicemanagement/managementservice.svc</TargetRef> 
      <SourceRef>urn:uuid:56722F8D-49D4-50EE-941E-A6CA9C316611</SourceRef> 
      <Data>212</Data> 
    </Status> 
    Similarly, you also need to respond with Status '200' (success) for each of the other commands sent by the client.


    Eric Fleck, Windows Store and Windows Phone Developer Support. If you would like to provide feedback or suggestions for future improvements to the Windows Phone SDK please go to http://wpdev.uservoice.com/ where you can post your suggestions and/or cast your votes for existing suggestions.


    • Edited by Eric Fleck Thursday, July 31, 2014 3:26 PM correct gramatical ambiguity
    • Marked as answer by winvil Friday, August 1, 2014 1:33 PM
    Thursday, July 31, 2014 3:24 PM