2013-07-02 3 views
2

안녕하세요 교환 개발자, Exchange 웹 서비스 API를 통해 MasterCategoryList에 추가 사용자 지정 범주를 삭제합니다. 나는 샘플 사용 :MS 아웃룩 2013 I 성공적으로 Exchange 웹 서비스 API를 통해 MasterCategoryList</strong><strong>에 여러 개의 사용자 정의 범주를 추가</p> <p>

var list = MasterCategoryList.Bind(service); 
list.Categories.Add(
    new Category { 
      Name = "Vacation", 
      Color = CategoryColor.DarkMaroon, 
      KeyboardShortcut = CategoryKeyboardShortcut.CtrlF10, 
      Id = Guid.NewGuid() 

을});

하지만 약간의 시간이 지나면 내 사용자 정의 범주가 어떤 이유로 MasterCategoryList에서 벗어났습니다. 나는 MS Exchange가 그것을 무효화 한 후 ("0000-0000 -...") "Idid"속성에 "Guid.NewGuid()"를 지정 했음에도 알았습니다. 아무도 그런 문제를 해결할 수 있습니까? 주목 해 주셔서 감사합니다. 문제가 아웃룩,하지 Exchange의 경우

+0

사용자 지정 범주가 마스터 목록 또는 개별 약속에서 사라진다는 것을 의미합니까 (질문을 편집하십시오)? EWS API에 대해 구체적으로 모르겠다. 원시 SOAP 호출로 작업하지만, 모든 * 약속 범주를 한 번에 대체해야한다. 따라서 하나를 추가하고, 모두 검색하고, 메모리 목록에 하나 추가하고, 약속에 모두 다시 기록하십시오. –

+0

안녕하세요. 나는 MS Outlook 2013에 문제가 있음을 알고 있었기 때문에 다음 작업을 수행했습니다. –

+0

안녕하세요. 저는 MS Outlook 2013에 문제가 있다는 것을 알고 있었기 때문에 EWS API를 통해 MasterCategoryList에 사용자 정의 카테고리를 삽입했습니다. 예를 들어 MS Outlook 2013 데스크톱 클라이언트를 통해 새 카테고리를 추가하십시오. 그 후에 EWS를 통해 MasterCategoryList를 검색합니다. 카테고리의 모든 ID는 "00000000-0000-0000-0000-000000000000"이됩니다. 얼마 후에 Exchange는 하나만 제외하고 내 모든 사용자 지정 범주를 삭제합니다. 이중화 ID 때문에 가정합니다. SOAP 호출에 대해 좀 더 자세히 설명해 주시겠습니까? –

답변

1

감사 할 수 있습니다.

이 문제가 해결 된 것 같습니다. "Id"속성 (Category 클래스)의 내용이 중괄호 안에 싸여 있어야합니다. 제 경우에는 "Id"속성에 "Guid"유형을 사용했습니다. "ToString"메서드와 "Id"속성이 "e6de9b1b-a81c-46f6-81b3-c23edfab4478"처럼 보이지만 유효한 값이 "{e6de9b1b-a81c-46f6-81b3-c23edfab4478}"인 Serializer가 적용되었습니다. 그래서 "Id"속성의 유형을 "string"으로 변경했습니다. 유효한 버전은 다음과 같습니다.

var list = MasterCategoryList.Bind(service); 

list.Categories.Add(

new Category { 
     Name = "Vacation", 
     Color = CategoryColor.DarkMaroon, 
     KeyboardShortcut = CategoryKeyboardShortcut.CtrlF10, 
     Id = "{" + Guid.NewGuid() + "}"; 

}); 

주의하시기 바랍니다.

0

, 어쩌면 당신은이 라인을 따라 뭔가를 시도 할 수 있습니다 :

SOAP 호출을 주요 범주 목록 검색 :

<soap:Envelope xmlns:mes="http://schemas.microsoft.com/exchange/services/2006/messages" 
       xmlns:typ="http://schemas.microsoft.com/exchange/services/2006/types" 
       xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> 
    <soap:Header> 
    <typ:RequestServerVersion Version="Exchange2010" /> 
    </soap:Header> 
    <soap:Body> 
    <mes:GetUserConfiguration> 
     <mes:UserConfigurationName Name="CategoryList"> 
     <typ:DistinguishedFolderId Id="calendar"/> 
     </mes:UserConfigurationName> 
     <mes:UserConfigurationProperties>All</mes:UserConfigurationProperties> 
    </mes:GetUserConfiguration> 
    </soap:Body> 
</soap:Envelope> 

응답 :

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> 
    <s:Header> 
     <h:ServerVersionInfo MajorVersion="14" MinorVersion="0" MajorBuildNumber="722" MinorBuildNumber="0" Version="Exchange2010" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"/> 
    </s:Header> 
    <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
     <m:GetUserConfigurationResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"> 
     <m:ResponseMessages> 
      <m:GetUserConfigurationResponseMessage ResponseClass="Success"> 
       <m:ResponseCode>NoError</m:ResponseCode> 
       <m:UserConfiguration> 
        <t:UserConfigurationName Name="CategoryList"> 
        <typ:DistinguishedFolderId Id="calendar" xmlns:typ="http://schemas.microsoft.com/exchange/services/2006/types"/> 
        </t:UserConfigurationName> 
        <t:ItemId Id="AAMkADky[snip]1VAZmIKAAAKfSM9AAA=" ChangeKey="CQAAAB[snip]AIlsUeV"/> 
        <t:XmlData>PD94bWw[snip]cmllcz4NCg==</t:XmlData> 
       </m:UserConfiguration> 
      </m:GetUserConfigurationResponseMessage> 
     </m:ResponseMessages> 
     </m:GetUserConfigurationResponse> 
    </s:Body> 
</s:Envelope> 

XMLData는 Base64로 인코딩되어 있습니다. 디코딩하면 다음과 같습니다.

<?xml version="1.0"?> 
<categories default="Red Category" lastSavedSession="2" lastSavedTime="2013-04-17T09:10:12.786" xmlns="CategoryList.xsd"> 
    <category name="Red Category" color="0" keyboardShortcut="0" usageCount="2" lastTimeUsedNotes="1601-01-01T00:00:00.000" lastTimeUsedJournal="1601-01-01T00:00:00.000" lastTimeUsedContacts="1601-01-01T00:00:00.000" lastTimeUsedTasks="1601-01-01T00:00:00.000" lastTimeUsedCalendar="1601-01-01T00:00:00.000" lastTimeUsedMail="1601-01-01T00:00:00.000" lastTimeUsed="2010-09-29T10:08:46.487" lastSessionUsed="0" guid="{61C23D24-ED86-47EC-8565-433E3A6B21B7}" renameOnFirstUse="1"/> 
    <category name="Blue Category" color="7" keyboardShortcut="0" usageCount="6" lastTimeUsedNotes="1601-01-01T00:00:00.000" lastTimeUsedJournal="1601-01-01T00:00:00.000" lastTimeUsedContacts="1601-01-01T00:00:00.000" lastTimeUsedTasks="1601-01-01T00:00:00.000" lastTimeUsedCalendar="2013-04-17T09:10:04.043" lastTimeUsedMail="1601-01-01T00:00:00.000" lastTimeUsed="2013-04-17T09:10:04.043" lastSessionUsed="2" guid="{E19DD512-BFF1-46D8-A858-54CC114872AD}"/> 
    <category name="Purple Category" color="8" keyboardShortcut="0" usageCount="2" lastTimeUsedNotes="1601-01-01T00:00:00.000" lastTimeUsedJournal="1601-01-01T00:00:00.000" lastTimeUsedContacts="1601-01-01T00:00:00.000" lastTimeUsedTasks="1601-01-01T00:00:00.000" lastTimeUsedCalendar="1601-01-01T00:00:00.000" lastTimeUsedMail="1601-01-01T00:00:00.000" lastTimeUsed="2010-09-29T10:08:46.487" lastSessionUsed="0" guid="{FD3AFB30-285E-4BF2-885E-F9FDFE00002E}" renameOnFirstUse="1"/> 
    <category name="Green Category" color="4" keyboardShortcut="0" usageCount="6" lastTimeUsedNotes="1601-01-01T00:00:00.000" lastTimeUsedJournal="1601-01-01T00:00:00.000" lastTimeUsedContacts="1601-01-01T00:00:00.000" lastTimeUsedTasks="1601-01-01T00:00:00.000" lastTimeUsedCalendar="2013-04-17T09:10:12.782" lastTimeUsedMail="1601-01-01T00:00:00.000" lastTimeUsed="2013-04-17T09:10:12.782" lastSessionUsed="2" guid="{C3DC51D0-1CC4-42CF-9FA9-75146905771F}"/> 
    <category name="Orange Category" color="1" keyboardShortcut="0" usageCount="2" lastTimeUsedNotes="1601-01-01T00:00:00.000" lastTimeUsedJournal="1601-01-01T00:00:00.000" lastTimeUsedContacts="1601-01-01T00:00:00.000" lastTimeUsedTasks="1601-01-01T00:00:00.000" lastTimeUsedCalendar="1601-01-01T00:00:00.000" lastTimeUsedMail="1601-01-01T00:00:00.000" lastTimeUsed="2010-09-29T10:08:46.487" lastSessionUsed="0" guid="{10C78B6F-5828-4B3C-AF0C-138AAAC52DAE}" renameOnFirstUse="1"/> 
    <category name="Yellow Category" color="3" keyboardShortcut="0" usageCount="2" lastTimeUsedNotes="1601-01-01T00:00:00.000" lastTimeUsedJournal="1601-01-01T00:00:00.000" lastTimeUsedContacts="1601-01-01T00:00:00.000" lastTimeUsedTasks="1601-01-01T00:00:00.000" lastTimeUsedCalendar="1601-01-01T00:00:00.000" lastTimeUsedMail="1601-01-01T00:00:00.000" lastTimeUsed="2010-09-29T10:08:46.487" lastSessionUsed="0" guid="{37CC21D3-B6A9-4DAE-A1FB-422249B9FBB0}" renameOnFirstUse="1"/> 
    <category name="TimeTell" color="7" keyboardShortcut="0" usageCount="7" lastTimeUsedNotes="1601-01-01T00:00:00.000" lastTimeUsedJournal="1601-01-01T00:00:00.000" lastTimeUsedContacts="1601-01-01T00:00:00.000" lastTimeUsedTasks="1601-01-01T00:00:00.000" lastTimeUsedCalendar="2013-04-17T09:09:59.980" lastTimeUsedMail="1601-01-01T00:00:00.000" lastTimeUsed="2013-04-17T09:09:59.980" lastSessionUsed="2" guid="{3348E50B-1763-42FB-A9E9-25B74038B9AA}"/> 
</categories> 

은 아마 당신은 당신의 대답이 뭔가를 사용 SetUserConfiguration ...