zoukankan      html  css  js  c++  java
  • EWS新建会议

    var ews = new ExchangeServiceBinding {
        Credentials = new NetworkCredential("user", "pass"),
        Url = "https://servername/ews/exchange.asmx",
        RequestServerVersionValue = new RequestServerVersion {
            Version = ExchangeVersionType.Exchange2007}
    };
    var startDate = new DateTime(2010, 9, 18, 16, 00, 00);
    var meeting = new CalendarItemType {
        IsMeeting = true,
        IsMeetingSpecified = true,
        Subject = "test EWS",
        Body = new BodyType {Value = "test body", BodyType1 = BodyTypeType.HTML},
        Start = startDate,
        StartSpecified = true,
        End = startDate.AddHours(1),
        EndSpecified = true,
        MeetingTimeZone = new TimeZoneType{
            TimeZoneName = TimeZone.CurrentTimeZone.StandardName, BaseOffset = "PT0H"},
        Location = "Meeting",
        RequiredAttendees = new [] {
            new AttendeeType{Mailbox =new EmailAddressType{
                             EmailAddress ="test1@domain.com",RoutingType = "SMTP"}},
            new AttendeeType{Mailbox =new EmailAddressType{
                             EmailAddress ="test2@domain.com",RoutingType = "SMTP"}}
        }
    };
    var request = new CreateItemType {
        SendMeetingInvitations =
            CalendarItemCreateOrDeleteOperationType.SendToAllAndSaveCopy,
        SendMeetingInvitationsSpecified = true,
        SavedItemFolderId = new TargetFolderIdType{Item = new DistinguishedFolderIdType{
                                            Id=DistinguishedFolderIdNameType.calendar}},
        Items = new NonEmptyArrayOfAllItemsType {Items = new ItemType[] {meeting}}
    };
    CreateItemResponseType response = ews.CreateItem(request);
    var responseMessage = response.ResponseMessages.Items[0];
     
    <CreateItem
           xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"
           SendMeetingInvitations="SendToAllAndSaveCopy" >
      <SavedItemFolderId>
        <t:DistinguishedFolderId Id="calendar"/>
      </SavedItemFolderId>
      <Items>
        <t:CalendarItem>
          <t:Subject>Meeting with attendee0, attendee1, attendee2</t:Subject>
          <t:Body BodyType="Text">CalendarItem:TextBody</t:Body>
          <t:Start>2006-06-25T10:00:00Z</t:Start>
          <t:End>2006-06-25T11:00:00Z</t:End>
          <t:Location>CalendarItem:Location</t:Location>
          <t:RequiredAttendees>
            <t:Attendee>
              <t:Mailbox>
                <t:EmailAddress>attendee0@example.com</t:EmailAddress>
              </t:Mailbox>
            </t:Attendee>
            <t:Attendee>
              <t:Mailbox>
                <t:EmailAddress>attendee1@example.com</t:EmailAddress>
              </t:Mailbox>
            </t:Attendee>
          </t:RequiredAttendees>
          <t:OptionalAttendees>
            <t:Attendee>
              <t:Mailbox>
                <t:EmailAddress>attendee2@example.com</t:EmailAddress>
              </t:Mailbox>
            </t:Attendee>
          </t:OptionalAttendees>
          <t:Resources>
            <t:Attendee>
              <t:Mailbox>
                <t:EmailAddress>room0@example.com</t:EmailAddress>
              </t:Mailbox>
            </t:Attendee>
          </t:Resources>
        </t:CalendarItem>
      </Items>
    </CreateItem>
     
    var meeting = new CalendarItemType
    {
        IsMeeting = true,
        Subject = "test EWS",
        Body = new BodyType { Value = "test body", BodyType1 = BodyTypeType.HTML },
        Start = startDate,
        StartSpecified = true,
        End = startDate.AddHours(1),
        EndSpecified = true,
        MeetingTimeZone = new TimeZoneType
        {
            TimeZoneName = TimeZone.CurrentTimeZone.StandardName,
            BaseOffset = "PT0H"
        },
        Location = "Room 1",
        RequiredAttendees = new[] {
            new AttendeeType
            {
                Mailbox =new EmailAddressType
                {    
                    EmailAddress ="test@test.com"
                }
            },
        }
    };

  • 相关阅读:
    解决xcode5升级后,Undefined symbols for architecture arm64:问题
    第8章 Foundation Kit介绍
    app 之间发送文件 ios
    iphone怎么检测屏幕是否被点亮 (用UIApplication的Delegate)
    CRM下载对象一直处于Wait状态的原因
    错误消息Customer classification does not exist when downloading
    How to resolve error message Distribution channel is not allowed for sales
    ABAP CCDEF, CCIMP, CCMAC, CCAU, CMXXX这些东东是什么鬼
    有了Debug权限就能干坏事?小心了,你的一举一动尽在系统监控中
    SAP GUI和Windows注册表
  • 原文地址:https://www.cnblogs.com/csts/p/2459201.html
Copyright © 2011-2022 走看看