I have spent days of trial and error, looked through exchange logs, and searched all over the internet and so far am unable to resolve this issue.
I am implementing ActiveSync capabilities within my iOS app and so far have successfully coded the autodiscover process and the HTTP OPTIONS request to get the server's capabilities. I am now trying to run the Provision command but keep getting 400 Bad Request.
Here is what I am sending to the server:
URL: https://mobile.[myexchangeserver].com/Microsoft-Server-ActiveSync?Cmd=Provision&User=jack&DeviceID=123412341234&DeviceType=iOS
Authorization = "Basic wekrju283j"; //Base 64 encoded auth, garbage for this posting
"Content-Length" = 104;
"Content-Type" = "application/vnd.ms-sync.wbxml";
"MS-ASProtocolVersion" = "12.1";
"User-Agent" = MyApp;
"X-MS-PolicyKey" = 0;
Body (converted to WBXML before sending):
<?xml version="1.0" encoding="utf-8"?>
<Provision xmlns="Provision:">
<Policies>
<Policy>
<PolicyType>MS-EAS-Provisioning-WBXML</PolicyType>
</Policy>
</Policies>
</Provision>
WBXML: 02 00 25 6A 41 50 72 6F 76 69 73 69 6F 6E 00 50 6F 6C 69 63 69 65 73 00 50 6F 6C 69 63 79 00 50 6F 6C 69 63 79 54 79 70 65 00 2D 2F 2F 41 49 52 53 59 4E 43 2F 2F 44 54 44 20 41 69 72 53 79 6E 63 2F 2F 45 4E 00 44 00 44 0A 44 13 44 1A 03 4D 53 2D 45 41 53 2D 00 83 00 03 69 6E 67 2D 57 42 58 4D 4C 00 01 01 01 01
Is there anyway I can find out more than just "Bad Request"? Or does anyone see anything wrong with what I'm sending in? The server supports the 12.1 protocol (from the OPTIONS request)
I've read through the protocol documentation over and over and still can't find anything wrong with what I'm doing. I know I can base64 encode the paramaters, but according the protocl docs that is optional. I also know that in 14.1 I need to send more information in the xml, hence why I'm using the 12.1 protocol.
Any help is greatly appreciated.