How to share schedules in the exchange service in the XML mode?

two mows 0 Reputation points
2024-07-29T06:49:08.32+00:00

How to share schedules in the exchange service in the XML mode?We tried the updateFolder method, but the error says that an internal server error has occurred. Operation failed.

Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,511 questions
{count} votes

2 answers

Sort by: Most helpful
  1. two mows 0 Reputation points
    2024-07-29T07:11:01.87+00:00
    <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
         <soap:Header>
           <t:RequestServerVersion Version="Exchange2013_SP1"/>
         </soap:Header>
         <soap:Body>
           <m:UpdateFolder>
             <m:FolderChanges>
               <t:FolderChange>
                 <t:FolderId Id="AAMkADIxOWE0MzBlLWZhMGUtNDIwYi05NTE0LTFmMWRlMmI3NGYxYQAuAAAAAABp9IVjukOxRrS8kMqSmya0AQDgJ233PD1DRp688jcacXBOAAB5/HMlAAA="/>
                 <t:Updates>
                   <t:SetFolderField>
                     <t:FieldURI FieldURI="folder:PermissionSet"/>
                     <t:Folder>
                       <t:PermissionSet>
                         <t:Permissions>
                           <t:Permission>
                             <t:UserId>
                               <t:PrimarySmtpAddress>weiliang.feng@archermind.com</t:PrimarySmtpAddress>
                             </t:UserId>
                             <t:CanCreateItems>false</t:CanCreateItems>
                             <t:CanCreateSubFolders>false</t:CanCreateSubFolders>
                             <t:IsFolderOwner>false</t:IsFolderOwner>
                             <t:IsFolderVisible>true</t:IsFolderVisible>
                             <t:IsFolderContact>false</t:IsFolderContact>
                             <t:EditItems>None</t:EditItems>
                             <t:DeleteItems>None</t:DeleteItems>
                             <t:ReadItems>FullDetails</t:ReadItems>
                             <t:PermissionLevel>Reviewer</t:PermissionLevel>
                           </t:Permission>
                         </t:Permissions>
                       </t:PermissionSet>
                     </t:Folder>
                   </t:SetFolderField>
                 </t:Updates>
               </t:FolderChange>
             </m:FolderChanges>
           </m:UpdateFolder>
         </soap:Body>
       </soap:Envelope>
    
    0 comments No comments

  2. Jake Zhang-MSFT 3,665 Reputation points Microsoft Vendor
    2024-07-30T02:16:36.6633333+00:00

    Hi @two mows,

    Welcome to the Microsoft Q&A platform!

    There can be multiple steps and methods involved when sharing a plan in an exchange service in XML mode. Based on the information you provided, an internal server error was encountered using the updateFolder method, which could be due to various reasons. Here are some possible solutions and checkpoints:

    1. Ensure that the account used to invoke the updateFolder method has sufficient privileges to perform the operation. Try using an administrator account to perform the operation.
    2. Ensure that the XML structure sent is correct and conforms to the specification. An incorrect XML structure may cause the server to fail to parse the request correctly.
    3. Check the log files of the Exchange Services server for more detailed error messages. These logs usually contain more debugging information to help locate the problem.
    4. Ensure that the incoming paths and parameters are correct. For example, verify that the folder path exists, that the destination folder is correct, and so on.
    5. Sometimes it is useful to try other similar methods or interfaces to see if they accomplish the same task. For example, try the createFolder method to create a folder, and then use the getFolder and setFolderPermissions methods to change the permissions.

    Assuming you are using Exchange Web Services (EWS) to share a calendar folder, here is a complete example showing how to share a specific calendar folder and assign permissions.

    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> <t:RequestServerVersion Version="Exchange2010" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" /> </soap:Header> <soap:Body> <UpdateFolder xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"> <FolderChanges> <FolderChange> <FolderId Id="calendar-folder-id" /> <!-- 用你目标文件夹的ID替换 --> <Updates> <SetFolderField> <CalendarFolder xmlns="http://schemas.microsoft.com/exchange/services/2006/types"> <PermissionSet> <CalendarPermissions> <CalendarPermission> <UserId> <PrimarySmtpAddress>weiliang.feng@archermind.com</PrimarySmtpAddress> </UserId> <CanCreateItems>false</CanCreateItems> <CanCreateSubFolders>false</CanCreateSubFolders> <IsFolderOwner>false</IsFolderOwner> <IsFolderVisible>true</IsFolderVisible> <IsFolderContact>false</IsFolderContact> <EditItems>None</EditItems> <DeleteItems>None</DeleteItems> <ReadItems>FullDetails</ReadItems> <CalendarPermissionLevel>Reviewer</CalendarPermissionLevel> </CalendarPermission> </CalendarPermissions> </PermissionSet> </CalendarFolder> </SetFolderField> </Updates> </FolderChange> </FolderChanges> </UpdateFolder> </soap:Body> </soap:Envelope>
    

    In this example:

    1. FolderId: Replace with the ID of your destination folder.
    2. PrimarySmtpAddress: Replaced with the SMTP address of the user you need to share the folder with.
    3. other fields like CanCreateItems, CanCreateSubFolders, IsFolderOwner, etc. are configured according to your needs.

    Please feel free to contact me if you have any queries.

    Best,

    Jake Zhang