Note that there are some explanatory texts on larger screens.

plurals
  1. POExchange 400 error on uploading meeting
    primarykey
    data
    text
    <p>I am trying to build a book your meeting application using exchange 2010 in Android. I am using <a href="http://code.google.com/p/corporateaddressbook/" rel="nofollow">CorporateContacts</a> to familiarise myself with activesync. I have managed to get ResolveRecipients , SendMail and FolderSync commands working so far. However when I am trying to upload a meeting request I am getting a 400 Bad Request Error. I am using <a href="http://msdn.microsoft.com/en-us/library/gg675603%28v=exchg.80%29.aspx" rel="nofollow">this</a> as reference.</p> <p>My xml</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;Sync xmlns:calendar="Calendar" xmlns="AirSync"&gt; &lt;Collections&gt; &lt;Collection&gt; &lt;SyncKey&gt;1425334024&lt;/SyncKey&gt; &lt;CollectionId&gt;4&lt;/CollectionId&gt; &lt;GetChanges&gt;1&lt;/GetChanges&gt; &lt;Commands&gt; &lt;Add&gt; &lt;ClientId&gt;5644895&lt;/ClientId&gt; &lt;ApplicationData&gt; &lt;calendar:TimeZone&gt;tv7//ygAVQBUAEMAKwAwADUAOgAzADAAKQAgAEMAaABlAG4AbgBhAGkALAAgAEsAbwBsAGsAYQB0AGEALAAgAE0AdQAAAAAAAAAAAAAAAAAAAAAAAAAAACgAVQBUAEMAKwAwADUAOgAzADAAKQAgAEMAaABlAG4AbgBhAGkALAAgAEsAbwBsAGsAYQB0AGEALAAgAE0AdQAAAAAAAAAAAAAAAAAAAAAAAAAAAA==&lt;/calendar:TimeZone&gt; &lt;calendar:StartTime&gt;20130109T100000Z&lt;/calendar:StartTime&gt; &lt;calendar:Subject&gt;TestMeeting&lt;/calendar:Subject&gt; &lt;calendar:UID&gt;040000008200E90074C5B7101A82E0080000000036BD76EAAAD5CA01000000000000000010000000C45185F686A5D542B20BF2CE2F477D55&lt;/calendar:UID&gt; &lt;calendar:Attendees&gt; &lt;calendar:Attendee&gt; &lt;calendar:Email&gt;Test@test.com&lt;/calendar:Email&gt; &lt;calendar:Name&gt;JohnDoe&lt;/calendar:Name&gt; &lt;calendar:AttendeeStatus&gt;0&lt;/calendar:AttendeeStatus&gt; &lt;calendar:AttendeeType&gt;1&lt;/calendar:AttendeeType&gt; &lt;/calendar:Attendee&gt; &lt;/calendar:Attendees&gt; &lt;calendar:Location&gt;My Office&lt;/calendar:Location&gt; &lt;calendar:EndTime&gt;20130109T110000Z&lt;/calendar:EndTime&gt; &lt;calendar:Sensitivity&gt;0&lt;/calendar:Sensitivity&gt; &lt;calendar:BusyStatus&gt;1&lt;/calendar:BusyStatus&gt; &lt;calendar:AllDayEvent&gt;0&lt;/calendar:AllDayEvent&gt; &lt;calendar:MeetingStatus&gt;1&lt;/calendar:MeetingStatus&gt; &lt;/ApplicationData&gt; &lt;/Add&gt; &lt;/Commands&gt; &lt;/Collection&gt; &lt;/Collections&gt; &lt;/Sync&gt; </code></pre> <p>The CreateHTTPPost function </p> <pre><code>private HttpPost createHttpPost(String uri, String requestXML, boolean includePolicyKey) throws Exception { // Set the common headers HttpPost httpPost = new HttpPost(uri); httpPost.setHeader("User-Agent", "Android"); httpPost.setHeader("Accept", "*/*"); httpPost.setHeader("Content-Type", "application/vnd.ms-sync.wbxml"); //httpPost.setHeader("Content-Type", "message/rfc822");//message/rfc822 // If we are connecting to Exchange 2010 or above // Lets tell the Exchange server that we are a 12.1 client // This is so we don't have to support sending of additional // information in the provision method if(getActiveSyncVersionFloat() &gt;= 14.0) httpPost.setHeader("MS-ASProtocolVersion", "12.1"); // Else set the version to the highest version returned by the // Exchange server else httpPost.setHeader("MS-ASProtocolVersion", getActiveSyncVersion()); //Log.d(TAG, mActiveSyncVersion); httpPost.setHeader("Accept-Language", "en-us"); httpPost.setHeader("Authorization", mAuthString); // Include policy key if required if (includePolicyKey) httpPost.setHeader("X-MS-PolicyKey", mPolicyKey); // Add the XML to the request if (requestXML != null) { //Log.d(TAG, requestXML); // Set the body // Convert the XML to WBXML ByteArrayInputStream xmlParseInputStream = new ByteArrayInputStream( requestXML.toString().getBytes()); java.io.ByteArrayOutputStream output = new java.io.ByteArrayOutputStream(); wbxml.convertXmlToWbxml(xmlParseInputStream, output); byte[] bytes = output.toByteArray(); ByteArrayEntity myEntity = new ByteArrayEntity(bytes); myEntity.setContentType("application/vnd.ms-sync.wbxml"); httpPost.setEntity(myEntity); } return httpPost; } </code></pre> <p>Is there any headers I am missing ? OR Any error with the xml? I will be extremely obliged if somebody can throw some light. I am using activesync version 12.1 in headers.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload