Condividi tramite


Issue with updating a PT_BINARY property using WebDAV

I ran into a strange issue yesterday when I was trying to update a Named property of type PT_BINARY using WebDAV. When I did the PROPPATCH it went through fine and did not fail. When I checked the Named property using MFC MAPI, it was there but the type had changed to PT_STRING8.

Below is the WebDAV request that I initially sent to update the PT_BINARY Named Property:

 <?xml version="1.0"?>
<a:propertyupdate xmlns:a="DAV:" xmlns:cal="https://schemas.microsoft.com/mapi/id/{00062002-0000-0000-C000-000000000046}/" 
                   xmlns:b="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882">
    <a:set>
        <a:prop>
            <cal:0x8216 b:dt="bin.base64">D4AAAAiIAAACgAAAAAAAAAAAAAAAAAAAOCVyAzA08gMBjAAAAkwAAAcAgAAWAIAAAAAAAAAAAAAAAA=</cal:0x8216>
        </a:prop>
    </a:set>
</a:propertyupdate>

In the request above, notice that I am specifying the data type also and the data is a byte array which is Base64 encoded. What could the problem be? Could this be a BUG?

The issue was happening because I was missing a "/". Below is the updated request that fixed the problem.

 <?xml version="1.0"?>
<a:propertyupdate xmlns:a="DAV:" xmlns:cal="https://schemas.microsoft.com/mapi/id/{00062002-0000-0000-C000-000000000046}/" 
                   xmlns:b="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/">
    <a:set>
        <a:prop>
            <cal:0x8216 b:dt="bin.base64">D4AAAAiIAAACgAAAAAAAAAAAAAAAAAAAOCVyAzA08gMBjAAAAkwAAAcAgAAWAIAAAAAAAAAAAAAAAA=</cal:0x8216>
        </a:prop>
    </a:set>
</a:propertyupdate>

I leave it for you to figure out where I was missing out the "/".