4 Protocol Examples

The following example of an AddImGroup WSDL operation request shows how to create an instant messaging group named MyCustomerGroup.

 <?xml version="1.0" encoding="UTF-8"?>
 <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
                xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
                xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">
    <soap:Header>
       <t:RequestServerVersion Version="Exchange2013" />
       <t:MailboxCulture>en-US</t:MailboxCulture>
    </soap:Header>
    <soap:Body >
       <m:AddImGroup>
          <m:DisplayName>MyCustomGroup</m:DisplayName>
       </m:AddImGroup>
    </soap:Body>
 </soap:Envelope>

The following example shows a successful response to an AddImGroup WSDL operation request. The store identifier has been shortened to preserve readability.

 <?xml version="1.0" encoding="utf-8"?>
 <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Header>
       <h:ServerVersionInfo MajorVersion="15"
                            MinorVersion="0"
                            MajorBuildNumber="349"
                            MinorBuildNumber="0"
                            Version="Exchange2013"
                            xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types"
                            xmlns="http://schemas.microsoft.com/exchange/services/2006/types"
                            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
    </s:Header>
    <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema">
       <AddImGroupResponse ResponseClass="Success"
                           xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
          <ResponseCode>NoError</ResponseCode>
          <ImGroup>
             <DisplayName xmlns="http://schemas.microsoft.com/exchange/services/2006/types">MyCustomGroup</DisplayName>
             <GroupType xmlns="http://schemas.microsoft.com/exchange/services/2006/types">IPM.DistList.MOC.UserGroup</GroupType>
             <ExchangeStoreId Id="AAMkAGQ1MjJjMTBkLTc4Y2UtNDA5Ny04ZjU5LWI3MAAA="
                              ChangeKey="EgAAAA=="
                              xmlns="http://schemas.microsoft.com/exchange/services/2006/types"/>
          </ImGroup>
       </AddImGroupResponse>
    </s:Body>
 </s:Envelope>

The following example shows how to add a contact (2) to an instant messaging group. The group and contact identifiers have been shortened to preserve readability.

 <?xml version="1.0" encoding="UTF-8"?>
 <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
                xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
                xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">
    <soap:Header>
       <t:RequestServerVersion Version="Exchange2013" />
       <t:MailboxCulture>en-US</t:MailboxCulture>
    </soap:Header>
    <soap:Body >
       <m:AddImContactToGroup>
          <m:ContactId Id="AAMkAGQ1MjJjMTBkLTc4Y2AA="
                       ChangeKey="EQAAABYAAABtF8oI7i"/>
          <m:GroupId Id="AAMkAGQ1MjJjMTBkzzAAAQKAAA="
                     ChangeKey="EgAAAA=="/>
       </m:AddImContactToGroup>
    </soap:Body>
 </soap:Envelope>

The following example shows a successful response to an AddImContactToGroup WSDL operation request.

 <?xml version="1.0" encoding="utf-8"?>
 <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Header>
       <h:ServerVersionInfo MajorVersion="15" 
                            MinorVersion="0" 
                            MajorBuildNumber="349" 
                            MinorBuildNumber="0" 
                            Version="Exchange2013" 
                            xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" 
                            xmlns="http://schemas.microsoft.com/exchange/services/2006/types" 
                            xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
                            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
    </s:Header>
    <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
            xmlns:xsd="http://www.w3.org/2001/XMLSchema">
       <AddImContactToGroupResponse ResponseClass="Success" 
                                    xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
          <ResponseCode>NoError</ResponseCode>
       </AddImContactToGroupResponse>
    </s:Body>
 </s:Envelope>

The following example of a RemoveImGroup WSDL operation request shows how to remove an instant messaging group. The group identifier has been shortened to preserve readability,

 <?xml version="1.0" encoding="UTF-8"?>
 <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
                xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
                xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">
    <soap:Header>
       <t:RequestServerVersion Version="Exchange2013" />
       <t:MailboxCulture>en-US</t:MailboxCulture>
    </soap:Header>
    <soap:Body >
       <m:RemoveImGroup>
          <m:GroupId Id="AAMkAGQ1MjJjMTBkLTc4Y2UtNDA5hQoTbWAAAAAAQRAAA="
                     ChangeKey="EgAAAA=="/>
       </m:RemoveImGroup>
    </soap:Body>
 </soap:Envelope>

The following example shows a successful response to a RemoveImGroup WSDL operation request.

 <?xml version="1.0" encoding="utf-8"?>
 <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Header>
       <h:ServerVersionInfo MajorVersion="15" 
                            MinorVersion="0" 
                            MajorBuildNumber="349" 
                            MinorBuildNumber="0" 
                            Version="Exchange2013" 
                            xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" 
                            xmlns="http://schemas.microsoft.com/exchange/services/2006/types" 
                            xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
                            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
    </s:Header>
    <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
            xmlns:xsd="http://www.w3.org/2001/XMLSchema">
       <RemoveImGroupResponse ResponseClass="Success" 
                              xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
          <ResponseCode>NoError</ResponseCode>
       </RemoveImGroupResponse>
    </s:Body>
 </s:Envelope>
Show: