EWS运营 - 参加会议的与会者

时间:2016-06-23 14:47:42

标签: exchangewebservices

到目前为止,使用EWS operations我能够在一个时间范围内获得所有会议。我如何得到会议的与会者?

我已阅读here我可以使用会议ID发送其他请求,以获取其他属性(LoadPropertiesForItem)。

相应的SOAP操作是什么?

由于

private String getXMLRequestForRetrieve( DateTime start, DateTime end, String meetingRoomEmailToQuery ){

    return ""+
        "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:typ=\"http://schemas.microsoft.com/exchange/services/2006/types\" xmlns:mes=\"http://schemas.microsoft.com/exchange/services/2006/messages\">"+
           "<soapenv:Header>"+
              "<typ:RequestServerVersion Version=\"Exchange2016\"/>"+
              "<typ:MailboxCulture>en-US</typ:MailboxCulture>"+
              "<typ:TimeZoneContext>"+
                "<typ:TimeZoneDefinition Id=\"W. Europe Standard Time\"/>"+
              "</typ:TimeZoneContext>"+
           "</soapenv:Header>"+
           "<soapenv:Body>"+
              "<mes:FindItem Traversal=\"Shallow\">"+
                 "<mes:ItemShape>"+
                    "<typ:BaseShape>AllProperties</typ:BaseShape>"+ // AllProperties, IdOnly
                    "<typ:AdditionalProperties>"+
                      "<typ:FieldURI FieldURI=\"item:Subject\" /> "+
                      "<typ:FieldURI FieldURI=\"item:DateTimeCreated\" />"+
                      "<typ:FieldURI FieldURI=\"item:Sensitivity\" />"+
                      "<typ:FieldURI FieldURI=\"calendar:Start\" />"+
                      "<typ:FieldURI FieldURI=\"calendar:End\" />"+
                      "<typ:FieldURI FieldURI=\"calendar:IsCancelled\" />"+
                      "<typ:FieldURI FieldURI=\"calendar:Organizer\"/>"+
                      // "<typ:FieldURI FieldURI=\"item:Body\" />"+
                      // "<typ:FieldURI FieldURI=\"calendar:RequiredAttendees\"/>"+
                    "</typ:AdditionalProperties>"+
                 "</mes:ItemShape>"+
                 "<mes:CalendarView MaxEntriesReturned=\"1000\""+
                        " StartDate=\""+start.toString(patternFormat)+
                        "\" EndDate=\""+end.toString(patternFormat)+"\"/>"+ // 2016-06-10T07:00:00Z
                 "<mes:ParentFolderIds>"+
                   "<typ:DistinguishedFolderId Id=\"calendar\">"+
                     "<typ:Mailbox>"+
                       "<typ:EmailAddress>"+meetingRoomEmailToQuery+"</typ:EmailAddress>"+
                     "</typ:Mailbox>"+
                   "</typ:DistinguishedFolderId>"+
                "</mes:ParentFolderIds>"+
              "</mes:FindItem>"+
           "</soapenv:Body>"+
        "</soapenv:Envelope>";
}

2 个答案:

答案 0 :(得分:1)

您需要制作EWS GetItem请求https://msdn.microsoft.com/en-us/library/office/aa566013(v=exchg.150).aspx,如果您尝试执行此操作的多个项目,则可以批量处理GetItem请求以提高其效率。

答案 1 :(得分:0)

我用这个SOAP请求解决了:

    private String getXMLReqForMeetingProperties(String itemId, String changeKey) { 

        return ""+
            "<?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:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" "+
                "xmlns:m=\"http://schemas.microsoft.com/exchange/services/2006/messages\" "+
                "xmlns:t=\"http://schemas.microsoft.com/exchange/services/2006/types\">"+
                "<soap:Header>"+
                   "<RequestServerVersion Version=\"Exchange2013\" "+
                    "xmlns=\"http://schemas.microsoft.com/exchange/services/2006/types\" soap:mustUnderstand=\"0\" />"+
                "</soap:Header>"+
                "<soap:Body>"+
                    "<m:GetItem Traversal=\"Shallow\">"+
                        "<m:ItemShape>"+
                            "<t:BaseShape>IdOnly</t:BaseShape>"+
                            "<t:AdditionalProperties>"+
                                "<t:FieldURI FieldURI=\"item:Subject\"></t:FieldURI>"+
                                // "<t:FieldURI FieldURI=\"item:Body\"></t:FieldURI>"+
                                "<t:FieldURI FieldURI=\"item:TextBody\"></t:FieldURI>"+
                            "</t:AdditionalProperties>"+
                        "</m:ItemShape>"+
                        "<m:ItemIds>"+
                            "<t:ItemId Id=\""+itemId+"\" ChangeKey=\""+changeKey+"\"></t:ItemId>"+
                        "</m:ItemIds>"+
                    "</m:GetItem>"+
                "</soap:Body>"+
            "</soap:Envelope>";
    }