none
PING command problem RRS feed

  • Question

  • Hi All

    I have a question. Can you help me please. so

    I need detect if my policyKey is expire or not? so I try it with PING command but I get status 3 error.
    here is my

    MS-ASProtocolVersion: 12.0
    Connection: keep-alive
    User-Agent: MSFT-PPC/5.2.1000
    Content-Type: application/vnd.ms-sync.wbxml
    Authorization: Basic (hiden this)
    X-MS-PolicyKey:policyKey

    here is response.

    <TvsPing >
    <TvsPingStatus >3</TvsPingStatus>
    </TvsPing>

    is there any way or can you tell me where is my request

     

     

    Thank You

     

    Thursday, June 9, 2011 4:00 PM

Answers

  • ialeksey,

    If you review the same document Brad Hards has reference, you will find the following information in Section 3.1.5.1. of [MS-ASPROV]:

    "Clients SHOULD send a Provision command request when first contacting the server to send device
    information, to obtain security policy settings, and to obtain a policy key for use in subsequent
    command requests. Clients SHOULD NOT send the Provision command again until receiving a
    status code<4> from the server indicating that it is necessary."

    Please also note the following behavior note in the Appendix regarding the status code for non-provisioned devices:

    "<4> Section 3.1.5.1: When the MS-ASProtocolVersion header is set to 12.1, the server sends an
    HTTP 449 response to request a Provision command from the client."

    There are two possible scenarios here. One is that the server will kick out a DeviceNotProvisioned as described in Section 2.2.4 of
    [MS-ASCMD]. This is will be contained in the 'Status' element in a response. The other scenario is receiving a receiving a Provision
    Command Error of 5 (Policy key mismatch): "The client is trying to acknowledge an out-of-date or invalid policy." in which the client
    should send another Provision request to obtain a valid key (described in Section 3.1.5.2 and Section 3.2.5.2 of [MS-ASPROV]).

    I hope this helps.

     

    • Proposed as answer by King Salemno Monday, June 13, 2011 2:16 PM
    • Marked as answer by King Salemno Tuesday, July 5, 2011 4:46 PM
    Monday, June 13, 2011 2:16 PM

All replies

  • Hi Isleksey,

     

    Thank you for your question.  An engineer from the Protocols team will reply soon.

     


    Bryan S. Burgin Senior Escalation Engineer Microsoft Protocol Open Specifications Team
    Thursday, June 9, 2011 7:40 PM
    Moderator
  • Thanks for replay.

    is there any solution for my question?

     

    Thanks.

    Friday, June 10, 2011 9:26 AM
  • If you're interested in how long it will typically take to get an answer, look at previous questions. As a rough guide, I allow at least a week for simple stuff, and 2-3 weeks for more complex issues. It seems like a long time, but the Microsoft guys have quite a lot of process stuff  to deal with for the Open Specifications queries (given the international legal issues around much of it), and that goes on top of the actual research, finding the right developers to work with, and so on.

    I don't think I understand your question about "where is my request?". You might try to explain what you're trying to do in more detail, and exactly what you're sending and receiving (without corrupting the message, or clearly notating which parts you've redacted).

    However it appears that this is covered in [MS-ASPROV] Section 3.1.5.1 "Provision Command", which states:

    The current security policy settings on the client are represented by a policy key, which SHOULD be
    sent to the server in the X-MS-PolicyKey field of the HTTP header of all protocol command requests
    except for the initial Provision command, the Ping command ([MS-ASCMD] section 2.2.2.11), and
    the HTTP OPTIONS command ([MS-ASHTTP] section 2.2.3). If the server returns a status
    code<3> in a command response indicating that the policy key of the client is out of date, the client
    issues a new Provision command to obtain the security policy settings and a new policy key.

    Note that the only policy key that the client can successfully use is a 0 on an initial request, or the
    value that it obtained from the PolicyKey element (section 2.2.2.41) of the most recent server
    response to a Provision command request. The PolicyKey value from an initial Provision
    command request for policy settings is temporary and can only be used in an acknowledgment
    phase Provision command request. The server response to this request includes a policy key that
    can be used for subsequent commands.

    Hope that helps.

    Brad

     

    Friday, June 10, 2011 10:26 AM

  • Thanks for replay.
    I trying send email. so what I am doing.

    1. send FolderSyncRequest
    2. send ProvisionRequest with X-MS-PolicyKey 0 .
    3.get temp and send ProvisionRequest with policy key and get policy key.
    4. after this trying send email .
    everything is work correct. but I have next situation.

    how I can check if my policy key is expired or not. I try do it by PING command.
    so if my policy key is expired I must download new provisioning for sending email.
    Friday, June 10, 2011 3:03 PM
  • You can't use PING for this (see the text I quoted: "except...PING command...").

    I think its a bad approach to test / check if policykey is expired, because its a race condition with your own code. It could expire between checking and using. So just do whatever you need to do, and handle expiry in that operation.

    • Proposed as answer by Brad Hards Sunday, June 12, 2011 4:30 AM
    Sunday, June 12, 2011 4:27 AM
  • ialeksey,

    If you review the same document Brad Hards has reference, you will find the following information in Section 3.1.5.1. of [MS-ASPROV]:

    "Clients SHOULD send a Provision command request when first contacting the server to send device
    information, to obtain security policy settings, and to obtain a policy key for use in subsequent
    command requests. Clients SHOULD NOT send the Provision command again until receiving a
    status code<4> from the server indicating that it is necessary."

    Please also note the following behavior note in the Appendix regarding the status code for non-provisioned devices:

    "<4> Section 3.1.5.1: When the MS-ASProtocolVersion header is set to 12.1, the server sends an
    HTTP 449 response to request a Provision command from the client."

    There are two possible scenarios here. One is that the server will kick out a DeviceNotProvisioned as described in Section 2.2.4 of
    [MS-ASCMD]. This is will be contained in the 'Status' element in a response. The other scenario is receiving a receiving a Provision
    Command Error of 5 (Policy key mismatch): "The client is trying to acknowledge an out-of-date or invalid policy." in which the client
    should send another Provision request to obtain a valid key (described in Section 3.1.5.2 and Section 3.2.5.2 of [MS-ASPROV]).

    I hope this helps.

     

    • Proposed as answer by King Salemno Monday, June 13, 2011 2:16 PM
    • Marked as answer by King Salemno Tuesday, July 5, 2011 4:46 PM
    Monday, June 13, 2011 2:16 PM