Content management API
Hi all,
We have few thousand contents in our content repository. I have developed code using CM API to checkout and approve them one by one and check-in back into the repository.
But it fails after approving few hundred contents, with timeout exception.
What is the way to overcome this?.
Regards,
Bharat.
Hi Bharat,
You could do a couple of things here - the easiest would be to increase your JTA timeout value, but you may also just chunk the work you're doing into more manageable pieces so you don't exceed the timeout value. For example, you could do this check-in over different areas of your node hierarchy at a time.
If you have the use-case to automatically publish newly created content you could write an event listener to do so.
Let me know if this helps or if your use case is different.
-Ryan
Similar Messages
-
Hi all,
i'm a beginer in weblogic portal.
i want to use content management API to publish content, such as add content type, add content, edit content . . .
can anybody help me or give me document link.
Thanks!!!There used to be a contentSamples App that pretty much did most of this, I cant find this online.
i have the zip for 9.2 (there shouldnt be many changes between 9.2 and 10) , if you want a copy of this app send me your email -
Programmatic "Content management API"?
Is there any programmatic (Java) "Content management API"?
I'm developing a webservice through which I want to "simulate" user activity in the portal - to add items, create folders etc.
My concept:
Deploy a Java webservice that calls CM API.
Call this webservice from a different (nonJava) application to do the task.
In other words, I need an API to connect to. Is it a good concept or possible at all?
Or is the only way PL\SQL?
Is this the right forum to ask?
Thank you, PeterEmil,
even there are not yet Java APIs for Content management, you can rely on PL/SQL APIs that exist.
These APIs are provided trough a database plsql package which is : WWSBR_API.(since 9.0.2.6)
http://www.oracle.com/technology/products/ias/portal/html/plsqldoc/pldoc1012/wwsbr_api.html
You just need, either to generate a WebService based on the different procedures of functions, or create you own WebServices accessing to these pacakges via jdbc.
Jdeveloper provide a wizzard for generating a WS from an existing PLSQL package.
There are some limitations (restrictions on data types or collections), but that works for most of case.
About Content API, there is a good probability that these APIs become more rich (I don't know if it will be both for Java and PlSql).
Patrick. -
EWS Managed API - Attachment content empty
Exchange 2010
Managed API 1.1
I'm grabbing attachments through EWS and serving them through a web service (WCF).
The code:
ownerId = ServiceFactory.MakeEmailAddress(ownerId);
var service = ServiceFactory.InstantiateService(ownerId);
var id = new AlternateId(IdFormat.HexEntryId, mailId, ownerId);
var convertedId = (AlternateId)service.ConvertId(id, IdFormat.EwsId);
var mail = EmailMessage.Bind(service, convertedId.UniqueId);
service.LoadPropertiesForItems(new[] { mail }, new PropertySet(ItemSchema.HasAttachments, ItemSchema.Attachments, ItemSchema.ParentFolderId));
var folder = Folder.Bind(service, mail.ParentFolderId);
var fileAttachment = (FileAttachment)mail.Attachments[int.Parse(index)];
fileAttachment.Load();
Response.ContentType = fileAttachment.ContentType;
Response.AddHeader("Content-Disposition",
"attachment; filename=\"{FILENAME}\""
.Replace("{FILENAME}", fileAttachment.Name.Replace("\"", "'")));
fileAttachment.Load(Response.OutputStream);
The problem is an attachment that seems like any other that returns 0 bytes in content and writes 0 bytes to the outputstream. I'm serving thousands of attachments without problems but this single one returns nothing. 3 other attachments in the same email
message download without problems and if I look at the email in the exchange store the attachment is there and can be opened with outlook without problems. When stepping through the code I can see that the .Content property of the attachment (after calling
Load()) is a byte[] with length 0.
Is there anything additional I need to look at to make sure the content of the email attachment is downloaded? Is there a known issue with certain types of attachments that I need to be aware of?
Regards, HögniI'm also facing the same issue. Below is the test case
Request
<?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:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Header>
<t:RequestServerVersion Version="Exchange2007_SP1"/>
</soap:Header>
<soap:Body>
<GetAttachment xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<AttachmentShape/>
<AttachmentIds>
<t:AttachmentId Id="AAMkADkxZTExYmYzLTNhNjYtNDVhZC1hMzAxLWIzMjJiOTZhNjc3MgBGAAAAAABDBmTDBIV/SrBeyEXp602zBwBvhQ5C5FifRa4nmfNLZFw2AAH1IZfuAAD9KAeK/K68QpkzVbTgFhg+AHy3pBsmAAABEgAQAM7EQkmoHfhNkjAyo4TroB0="/>
</AttachmentIds>
</GetAttachment>
</soap:Body>
</soap:Envelope>
Response
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<t:ServerVersionInfo xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" MajorVersion="8" MinorVersion="3" MajorBuildNumber="279"
MinorBuildNumber="5" Version="Exchange2007_SP1"/>
</soap:Header>
<soap:Body>
<m:GetAttachmentResponse xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">
<m:ResponseMessages>
<m:GetAttachmentResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:Attachments>
<t:FileAttachment>
<t:AttachmentId Id="AAMkADkxZTExYmYzLTNhNjYtNDVhZC1hMzAxLWIzMjJiOTZhNjc3MgBGAAAAAABDBmTDBIV/SrBeyEXp602zBwBvhQ5C5FifRa4nmfNLZFw2AAH1IZfuAAD9KAeK/K68QpkzVbTgFhg+AHy3pBsmAAABEgAQAM7EQkmoHfhNkjAyo4TroB0="/>
<t:Name>@</t:Name>
<t:Content/>
</t:FileAttachment>
</m:Attachments>
</m:GetAttachmentResponseMessage>
</m:ResponseMessages>
</m:GetAttachmentResponse>
</soap:Body>
</soap:Envelope>
Regards,
Somnath Panja -
public void ShareCalendar(Calendar calendar)
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
service.Credentials = new NetworkCredential("user1", "password", "domain");
service.Url = new Uri("https://sampleUrl/ews/exchange.asmx");
try
// Bind to the folder
//Folder folderStoreInfo;
//folderStoreInfo = Folder.Bind(service, calendar.ExchangeId);
//string EwsID = folderStoreInfo.Id.UniqueId;
string EwsID = calendar.FolderExchangeId;
// The value of folderidHex will be what we need to use for the FolderId in the xml file
AutodiscoverService autoDiscover = new AutodiscoverService(ExchangeVersion.Exchange2013);
autoDiscover.Credentials = new NetworkCredential("user1", "password", "domain");
autoDiscover.RedirectionUrlValidationCallback = RedirectionUrlValidationCallback;
Dictionary<string, string> userSettings = GetUserSettings(autoDiscover);
string folderidHex = GetConvertedEWSIDinHex(service, EwsID, "[email protected]");
string domainName = string.Empty;
string mailBoxServer = string.Empty;
string userName = string.Empty;
foreach (var item in userSettings)
switch (item.Key)
case "UserDN":
domainName = item.Value.ToString();
break;
case "InternalMailboxServer":
mailBoxServer = item.Value.ToString();
break;
case "UserDisplayName":
userName = item.Value.ToString();
break;
string entryId = GetIntiatorEntryID(domainName);
string mailboxId = GetInvitationMailboxId(mailBoxServer, domainName);
string sharedFilePath = CreateSharingMessageAttachment(folderidHex, userName, entryId, mailboxId, "[email protected]", "calendar", calendar.FolderName);
// Create a new message
EmailMessage invitationRequest = new EmailMessage(service);
invitationRequest.Subject = "I'd like to share my calendar with you";
invitationRequest.Body = "Sent by Exchange Administrator on behalf of user";
//invitationRequest.Culture = "en-US";
invitationRequest.Sensitivity = Sensitivity.Normal;
// Set a sharing specific property on the message
invitationRequest.ItemClass = "IPM.Sharing"; /* Constant Required Value [MS-ProtocolSpec] */
byte[] byteEntryId = HexStringToByteArray(entryId);
// This is the Guid of the Sharing Provider in Exchange, and it's value does not change
Guid binSharingProviderGuid = new Guid("{AEF00600-0000-0000-C000-000000000046}");
// Even though I don't think setting this property is mandatory,
// it just seemed like the right thing to do and it works so I \
// ain't messin with it!
byte[] byteSharingProviderGuid = binSharingProviderGuid.ToByteArray();
string strPRBODYHTML = "<html dir=\"ltr\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\r\n<meta name=\"GENERATOR\"
content=\"MSHTML 8.00.7601.17514\">\r\n<style id=\"owaParaStyle\">P {\r\n MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px \r\n}\r\n</style>\r\n</head>\r\n<body fPStyle=\"1\" ocsi=\"0\">\r\n<tt>\r\n<pre>SharedByUserDisplayName
(SharedByUserSmtpAddress) has invited you to view his or her Microsoft Exchange Calendar.\r\n\r\nFor instructions on how to view shared folders on Exchange, see the following article:\r\n\r\nhttp://go.microsoft.com/fwlink/?LinkId=57561\r\n\r\n*~*~*~*~*~*~*~*~*~*\r\n\r\n</pre>\r\n</tt>\r\n<div>\r\n<div
style=\"direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;\">this is a test message</div>\r\n</div>\r\n</body>\r\n</html>\r\n";
string strBODY = @"
SharedByUserDisplayName (SharedByUserSmtpAddress) has invited you to view his or
her Microsoft Exchange Calendar.
For instructions on how to view shared folders on Exchange, see the
following article:
http://go.microsoft.com/fwlink/?LinkId=57561
*~*~*~*~*~*~*~*~*~*
test body
// Convert these to hex and binary equivelants to assign to their relevant
// extended properties
string hexPRBODYHTML = ConvertStringToHex(strPRBODYHTML);
byte[] binPRBODYHTML = HexStringToByteArray(hexPRBODYHTML);
Guid PropertySetSharing = Guid.Parse("00062040-0000-0000-C000-000000000046");//constant
Guid PropertySetInternetHeaders = Guid.Parse("00020386-0000-0000-C000-000000000046");//constant
ExtendedPropertyDefinition PidLidSharingProviderGuidProperty = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A01, MapiPropertyType.CLSID);
ExtendedPropertyDefinition ConversationIdProperty = new ExtendedPropertyDefinition(0x3013, MapiPropertyType.Binary);
// Sharing Properties (in order of reference according to protocol examples in: [MS-OXSHARE])
// Additional Property Constraints
// [MS-OXSHARE] 2.2.5.2
ExtendedPropertyDefinition PidTagMessageClass = new ExtendedPropertyDefinition(0x001A, MapiPropertyType.String);
// [MS-OXSHARE] 2.2.5.1
//ExtendedPropertyDefinition PidNameContentClass = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.InternetHeaders, "Content-Class", MapiPropertyType.String);
ExtendedPropertyDefinition PidNameContentClass = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "Content-class", MapiPropertyType.String);
// Common Message Object Properties
// [MS-OXSHARE] 2.2.1
ExtendedPropertyDefinition PidTagNormalizedSubject = new ExtendedPropertyDefinition(0x0E1D, MapiPropertyType.String);
// The PidTagSubjectPrefix is a zero-length string, so I do not set it
// ExtendedPropertyDefinition PidTagSubjectPrefix = new ExtendedPropertyDefinition(0x003D, MapiPropertyType.String);
// Sharing Object Message Properties
// [MS-OXSHARE] 2.2.2.12
ExtendedPropertyDefinition PidLidSharingProviderGuid = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A01, MapiPropertyType.Binary);
// [MS-OXSHARE] 2.2.2.13
ExtendedPropertyDefinition PidNameXSharingProviderGuid = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Provider-GUID", MapiPropertyType.String);
// [MS-OXSHARE] 2.2.2.14
ExtendedPropertyDefinition PidLidSharingProviderName = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A02, MapiPropertyType.String);
// [MS-OXSHARE] 2.2.2.15
ExtendedPropertyDefinition PidNameXSharingProviderName = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Provider-Name", MapiPropertyType.String);
// [MS-OXSHARE] 2.2.2.16
ExtendedPropertyDefinition PidLidSharingProviderUrl = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A03, MapiPropertyType.String);
// [MS-OXSHARE] 2.2.2.17
ExtendedPropertyDefinition PidNameXSharingProviderUrl = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Provider-URL", MapiPropertyType.String);
// [MS-OXSHARE] 2.2.2.5
ExtendedPropertyDefinition PidLidSharingFlavor = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A18, MapiPropertyType.Integer);
// [MS-OXSHARE] 2.2.2.6
ExtendedPropertyDefinition PidNameXSharingFlavor = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Flavor", MapiPropertyType.String);
// [MS-OXSHARE] 2.2.2.1
ExtendedPropertyDefinition PidLidSharingCapabilities = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A17, MapiPropertyType.Integer);
// [MS-OXSHARE] 2.2.2.2
ExtendedPropertyDefinition PidNameXSharingCapabilities = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Capabilities", MapiPropertyType.String);
// Sections 2.3 and 2.4 are also zero-length strings, so I won't set those either
// [MS-OXSHARE] 2.2.2.3
// ExtendedPropertyDefinition PidLidSharingConfigurationUrl = new //ExtendedPropertyDefinition(PropertySetSharing, 0x8A24, MapiPropertyType.String);
// [MS-OXSHARE] 2.2.2.4
//ExtendedPropertyDefinition PidNameXSharingConfigUrl = new //ExtendedPropertyDefinition(DefaultExtendedPropertySet.InternetHeaders, "X-Sharing-Config-Url", MapiPropertyType.String);
// [MS-OXSHARE] 2.2.2.10
ExtendedPropertyDefinition PidLidSharingLocalType = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A14, MapiPropertyType.String);
// [MS-OXSHARE] 2.2.2.11
ExtendedPropertyDefinition PidNameXSharingLocalType = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Local-Type", MapiPropertyType.String);
// [MS-OXSHARE] 2.2.2.7
ExtendedPropertyDefinition PidLidSharingInitiatorEntryId = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A09, MapiPropertyType.Binary);
// [MS-OXSHARE] 2.2.2.8
ExtendedPropertyDefinition PidLidSharingInitiatorName = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A07, MapiPropertyType.String);
// [MS-OXSHARE] 2.2.2.9
ExtendedPropertyDefinition PidLidSharingInitiatorSMTP = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A08, MapiPropertyType.String);
// [MS-OXSHARE] 2.2.3.1
ExtendedPropertyDefinition PidLidSharingRemoteName = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A05, MapiPropertyType.String);
// [MS-OXSHARE] 2.2.3.2
ExtendedPropertyDefinition PidNameXSharingRemoteName = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Name", MapiPropertyType.String);
// [MS-OXSHARE] 2.2.3.5
ExtendedPropertyDefinition PidLidSharingRemoteType = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A1D, MapiPropertyType.String);
// [MS-OXSHARE] 2.2.3.6
ExtendedPropertyDefinition PidNameXSharingRemoteType = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Type", MapiPropertyType.String);
// [MS-OXSHARE] 2.2.3.7
ExtendedPropertyDefinition PidLidSharingRemoteUid = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A06, MapiPropertyType.String);
// [MS-OXSHARE] 2.2.3.8
ExtendedPropertyDefinition PidNameXSharingRemoteUid = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Uid", MapiPropertyType.String);
// [MS-OXSHARE] 2.2.3.3
ExtendedPropertyDefinition PidLidSharingRemoteStoreUid = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A48, MapiPropertyType.String);
// [MS-OXSHARE] 2.2.3.4
ExtendedPropertyDefinition PidNameXSharingRemoteStoreUid = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Store-Uid", MapiPropertyType.String);
//From troubleshooting I noticed I was missing
ExtendedPropertyDefinition PidTagPriority = new ExtendedPropertyDefinition(0x0026, MapiPropertyType.Integer);
ExtendedPropertyDefinition PidTagSensitivity = new ExtendedPropertyDefinition(0x0036, MapiPropertyType.Integer);
ExtendedPropertyDefinition PR_BODY_HTML = new ExtendedPropertyDefinition(0x1013, MapiPropertyType.Binary); //PR_BOD
ExtendedPropertyDefinition PR_BODY = new ExtendedPropertyDefinition(0x1000, MapiPropertyType.String);
ExtendedPropertyDefinition RecipientReassignmentProhibited = new ExtendedPropertyDefinition(0x002b, MapiPropertyType.Boolean);
// Section 2.2.1
invitationRequest.SetExtendedProperty(PidTagNormalizedSubject, "I'd like to share my calendar with you"); /* Constant Required Value [MS-OXSHARE] 2.2.1 */
//invitationRequest.SetExtendedProperty(PidTagSubjectPrefix, String.Empty); /* Constant Required Value [MS-OXSHARE] 2.2.1 */
// Section 2.2.2
invitationRequest.SetExtendedProperty(PidLidSharingCapabilities, 0x40220); /* value for Special Folders */
invitationRequest.SetExtendedProperty(PidNameXSharingCapabilities, "40220"); /* Test representation of SharingCapabilities value */
//invitationRequest.SetExtendedProperty(PidLidSharingConfigurationUrl, String.Empty); /* Zero-Length String [MS-OXSHARE] 2.2.2.3 */
//invitationRequest.SetExtendedProperty(PidNameXSharingConfigUrl, String.Empty); /* Zero-Length String [MS-OXSHARE] 2.2.2.4 */
invitationRequest.SetExtendedProperty(PidLidSharingFlavor, 0x20310); /* Indicates Invitation for a special folder [MS-OXSHARE] 2.2.2.5 */
invitationRequest.SetExtendedProperty(PidNameXSharingFlavor, "20310"); /* Text representation of SharingFlavor value [MS-OXSHARE] 2.2.2.6 */
invitationRequest.SetExtendedProperty(PidLidSharingInitiatorEntryId, byteEntryId); /* Value from the Initiator/EntryId value in the Sharing Message attachment .xml document */
invitationRequest.SetExtendedProperty(PidLidSharingInitiatorSMTP, "[email protected]"); /* Value from Initiator/Smtp Address in the Sharing message attachment .xml document */
invitationRequest.SetExtendedProperty(PidLidSharingInitiatorName, "User1"); /* Value from Initiator/Name Address in the Sharing message attachment .xml document */
invitationRequest.SetExtendedProperty(PidLidSharingLocalType, "IPF.Appointment"); /* MUST be set to PidTagContainerClass of folder to be shared */
invitationRequest.SetExtendedProperty(PidNameXSharingLocalType, "IPF.Appointment"); /* MUST be set to same value as PidLidSharingLocalType */
invitationRequest.SetExtendedProperty(PidLidSharingProviderGuid, byteSharingProviderGuid); /* Constant Required Value [MS-OXSHARE] 2.2.2.12 */
invitationRequest.SetExtendedProperty(PidNameXSharingProviderGuid, "AEF0060000000000C000000000000046"); /* Constant Required Value [MS-OXSHARE] 2.2.2.13 */
invitationRequest.SetExtendedProperty(PidLidSharingProviderName, "Microsoft Exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.14 */
invitationRequest.SetExtendedProperty(PidNameXSharingProviderName, "Microsoft Exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.15] */
invitationRequest.SetExtendedProperty(PidLidSharingProviderUrl, "http://www.microsoft.com/exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.16 */
invitationRequest.SetExtendedProperty(PidNameXSharingProviderUrl, "http://www.microsoft.com/exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.17 */
// Section 2.2.3
invitationRequest.SetExtendedProperty(PidLidSharingRemoteName, calendar.FolderName); /* MUST be set to PidTagDisplayName of the folder being shared */
invitationRequest.SetExtendedProperty(PidNameXSharingRemoteName, calendar.FolderName); /* MUST be set to same value as PidLidSharingRemoteName */
invitationRequest.SetExtendedProperty(PidLidSharingRemoteStoreUid, mailboxId); /* Must be set to PidTagStoreEntryId of the folder being shared */
invitationRequest.SetExtendedProperty(PidNameXSharingRemoteStoreUid, mailboxId); /* MUST be set to same value as PidLidSharingRemoteStoreUid */
invitationRequest.SetExtendedProperty(PidLidSharingRemoteType, "IPF.Appointment"); /* Constant Required Value [MS-OXSHARE] 2.2.3.5 */
invitationRequest.SetExtendedProperty(PidNameXSharingRemoteType, "IPF.Appointment"); /* Constant Required Value [MS-OXSHARE] 2.2.3.6 */
invitationRequest.SetExtendedProperty(PidLidSharingRemoteUid, folderidHex); /* MUST be set to PidTagEntryId of folder being shared */
invitationRequest.SetExtendedProperty(PidNameXSharingRemoteUid, folderidHex); /* Must be set to same value as PidLidSharingRemoteUid */
// Section 2.2.5
invitationRequest.SetExtendedProperty(PidNameContentClass, "Sharing"); /* Constant Required Value [MS-ProtocolSpec] */
invitationRequest.SetExtendedProperty(PidTagMessageClass, "IPM.Sharing"); /* Constant Required Value [MS-ProtocolSpec] */
// ********* ADDITIONAL MAPPED PROPERTIES IM FINDING AS I TROUBLESHOOT ********************** //
invitationRequest.SetExtendedProperty(PidTagPriority, 0); /* From troubleshooting I'm just trying to match up values that were missing */
invitationRequest.SetExtendedProperty(PidTagSensitivity, 0); /* From troubleshooting as well */
invitationRequest.SetExtendedProperty(PR_BODY_HTML, binPRBODYHTML); /* From troubleshooting OWA error pointing to serializing HTML failing */
invitationRequest.SetExtendedProperty(PR_BODY, strBODY);
invitationRequest.SetExtendedProperty(RecipientReassignmentProhibited, true); /* Because it seemed like a good idea */
// Add a file attachment by using a stream
// We need to do the following in order to prevent 3 extra bytes from being prepended to the attachment
string sharMetadata = File.ReadAllText(sharedFilePath, Encoding.ASCII);
byte[] fileContents;
UTF8Encoding encoding = new System.Text.UTF8Encoding();
fileContents = encoding.GetBytes(sharMetadata);
//fileContents = File.ReadAllBytes(sharedFilePath);
//// fileContents is a Stream object that represents the content of the file to attach.
invitationRequest.Attachments.AddFileAttachment("sharing_metadata.xml", fileContents);
////invitationRequest.Attachments.AddFileAttachment(sharedFilePath);
//// This is where we set those "special" headers and other pertinent
//// information I noted in Part 1 of this series...
//Attachment thisAttachment = invitationRequest.Attachments[0];
//thisAttachment.ContentType = "application/x-sharing-metadata-xml";
//thisAttachment.Name = "sharing_metadata.xml";
//thisAttachment.IsInline = false;
// Add recipient info and send message
invitationRequest.ToRecipients.Add(new EmailAddress() { Address = "[email protected]" });
invitationRequest.SendAndSaveCopy();
// I always end my methods by returning the EWS
// impersonated user to null to clean up
service.ImpersonatedUserId = null;
catch (Exception ex)
public String GetConvertedEWSIDinHex(ExchangeService esb, String sID, String strSMTPAdd)
// Create a request to convert identifiers.
AlternateId objAltID = new AlternateId();
objAltID.Format = IdFormat.EwsId;
objAltID.Mailbox = strSMTPAdd;
objAltID.UniqueId = sID;
//Convert PR_ENTRYID identifier format to an EWS identifier.
AlternateIdBase objAltIDBase = esb.ConvertId(objAltID, IdFormat.HexEntryId);
AlternateId objAltIDResp = (AlternateId)objAltIDBase;
return objAltIDResp.UniqueId.ToString();
public String GetInvitationMailboxId(string mailBoxServer, string domainName)
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
service.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "[email protected]");
// Generate The Store Entry Id for the impersonated user
StringBuilder MailboxIDPointer = new StringBuilder();
string fqdn = mailBoxServer;
string legacyDN = domainName;
MailboxIDPointer.Append("00000000"); /* Flags */
MailboxIDPointer.Append("38A1BB1005E5101AA1BB08002B2A56C2"); /* ProviderUID */
MailboxIDPointer.Append("00"); /* Version */
MailboxIDPointer.Append("00"); /* Flag */
MailboxIDPointer.Append("454D534D44422E444C4C00000000"); /* DLLFileName */
MailboxIDPointer.Append("00000000"); /* Wrapped Flags */
MailboxIDPointer.Append("1B55FA20AA6611CD9BC800AA002FC45A"); /* WrappedProvider UID (Mailbox Store Object) */
MailboxIDPointer.Append("0C000000"); /* Wrapped Type (Mailbox Store) */
MailboxIDPointer.Append(ConvertStringToHex(fqdn)); /* ServerShortname (FQDN) */
MailboxIDPointer.Append("00"); /* termination bit */
MailboxIDPointer.Append(ConvertStringToHex(legacyDN)); /* Returns the userDN of the impersonated user */
MailboxIDPointer.Append("00"); /* terminator bit */
service.ImpersonatedUserId = null;
return MailboxIDPointer.ToString();
static bool RedirectionUrlValidationCallback(String redirectionUrl)
bool redirectionValidated = false;
if (redirectionUrl.Equals("https://SampleUrl/autodiscover/autodiscover.xml"))
redirectionValidated = true;
return redirectionValidated;
public String GetIntiatorEntryID(string domainName)
String result = String.Empty;
//// Bind to EWS
//ExchangeService service = ExchangeConnection.ExchangeService();
//service.ImpersonatedUserId =
//new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "[email protected]");
//// Get LegacyDN Using the function above this one
string sharedByLegacyDN = domainName;
// A conversion function from earlier
string legacyDNinHex = ConvertStringToHex(sharedByLegacyDN);
StringBuilder addBookEntryId = new StringBuilder();
addBookEntryId.Append("00000000"); /* Flags */
addBookEntryId.Append("DCA740C8C042101AB4B908002B2FE182"); /* ProviderUID */
addBookEntryId.Append("01000000"); /* Version */
addBookEntryId.Append("00000000"); /* Type - 00 00 00 00 = Local Mail User */
addBookEntryId.Append(legacyDNinHex); /* Returns the userDN of the impersonated user */
addBookEntryId.Append("00"); /* terminator bit */
result = addBookEntryId.ToString();
//service.ImpersonatedUserId = null;
return result;
public string ConvertStringToHex(string input)
// Take our input and break it into an array
char[] arrInput = input.ToCharArray();
String result = String.Empty;
// For each set of characters
foreach (char element in arrInput)
if (String.IsNullOrEmpty(result))
result = String.Format("{0:X2}", Convert.ToUInt16(element)).ToString();
else
result += String.Format("{0:X2}", Convert.ToUInt16(element)).ToString();
return result.ToString();
public string CreateSharingMessageAttachment(string folderid, string userSharing, string userSharingEntryID, string invitationMailboxID, string userSharedTo, string dataType, string calendarName)
XmlDocument sharedMetadataXML = new XmlDocument();
string sharedMetaDataFilePath = string.Empty;
try
// Create a String that contains our new sharing_metadata.xml file
StringBuilder metadataString = new StringBuilder("<?xml version=\"1.0\"?>");
metadataString.Append("<SharingMessage xmlns=\"http://schemas.microsoft.com/sharing/2008\">");
metadataString.Append("<DataType>" + dataType + "</DataType>");
metadataString.Append("<Initiator>");
metadataString.Append("<Name>" + userSharing + "</Name>");
metadataString.Append("<SmtpAddress>" + "[email protected]" + "</SmtpAddress><EntryId>" + userSharingEntryID.Trim());
metadataString.Append("</EntryId>");
metadataString.Append("</Initiator>");
metadataString.Append("<Invitation>");
metadataString.Append("<Title>" + calendarName + "</Title>");
metadataString.Append("<Providers>");
metadataString.Append("<Provider Type=\"ms-exchange-internal\" TargetRecipients=\"" + userSharedTo + "\">");
metadataString.Append("<FolderId xmlns=\"http://schemas.microsoft.com/exchange/sharing/2008\">");
metadataString.Append(folderid);
metadataString.Append("</FolderId>");
metadataString.Append("<MailboxId xmlns=\"http://schemas.microsoft.com/exchange/sharing/2008\">");
metadataString.Append(invitationMailboxID);
metadataString.Append("</MailboxId>");
metadataString.Append("</Provider>");
metadataString.Append("</Providers>");
metadataString.Append("</Invitation>");
metadataString.Append("</SharingMessage>");
sharedMetadataXML.LoadXml(metadataString.ToString());
string tempPath = System.IO.Path.GetTempPath();
sharedMetaDataFilePath = tempPath + "sharing_metadata.xml";
sharedMetadataXML.Save(sharedMetaDataFilePath);
catch (Exception eg)
throw eg;
return sharedMetaDataFilePath;
public Dictionary<string, string> GetUserSettings(AutodiscoverService autodiscoverService)
GetUserSettingsResponse userresponse = autodiscoverService.GetUserSettings(
"[email protected]",
UserSettingName.UserDisplayName,
UserSettingName.InternalMailboxServerDN,
UserSettingName.UserDN
Dictionary<string, string> myUserSettings = new Dictionary<string, string>();
foreach (KeyValuePair<UserSettingName, Object> usersetting in userresponse.Settings)
if (usersetting.Key.ToString() == "InternalMailboxServerDN")
int lastIndexOfEqual = usersetting.Value.ToString().LastIndexOf("=");
string subString = usersetting.Value.ToString().Substring(lastIndexOfEqual + 1);
string value = subString;
myUserSettings.Add("InternalMailboxServer", value.ToString());
if (usersetting.Key.ToString() == "UserDisplayName")
string[] arrResult = usersetting.Value.ToString().Split('.');
myUserSettings.Add("UserDisplayName", arrResult[0].ToString());
if (usersetting.Key.ToString() == "UserDN")
string[] arrResult = usersetting.Value.ToString().Split('.');
myUserSettings.Add("UserDN", arrResult[0].ToString());
return myUserSettings;
private static byte[] HexStringToByteArray(string input)
byte[] Bytes;
int ByteLength;
string HexValue = "\x0\x1\x2\x3\x4\x5\x6\x7\x8\x9|||||||\xA\xB\xC\xD\xE\xF";
ByteLength = input.Length / 2;
Bytes = new byte[ByteLength];
for (int x = 0, i = 0; i < input.Length; i += 2, x += 1)
Bytes[x] = (byte)(HexValue[Char.ToUpper(input[i + 0]) - '0'] << 4);
Bytes[x] |= (byte)(HexValue[Char.ToUpper(input[i + 1]) - '0']);
return Bytes;Hi,
I'm trying to share a calendar through ews managed api v.2 and using exchange 2013 version.
i'm preparing a shared calendar and providing values to extended properties .
Here comes the problem when i'm trying to send the sharing request(email message)
The following is code snippet.
public void ShareCalendar(Calendar calendar)
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
service.Credentials = new NetworkCredential("user1", "password", "domain");
service.Url = new Uri("https://sampleUrl/ews/exchange.asmx");
try
// Bind to the folder
//Folder folderStoreInfo;
//folderStoreInfo = Folder.Bind(service, calendar.ExchangeId);
//string EwsID = folderStoreInfo.Id.UniqueId;
string EwsID = calendar.FolderExchangeId;
// The value of folderidHex will be what we need to use for the FolderId in the xml file
AutodiscoverService autoDiscover = new AutodiscoverService(ExchangeVersion.Exchange2013);
autoDiscover.Credentials = new NetworkCredential("user1", "password", "domain");
autoDiscover.RedirectionUrlValidationCallback = RedirectionUrlValidationCallback;
Dictionary<string, string> userSettings = GetUserSettings(autoDiscover);
string folderidHex = GetConvertedEWSIDinHex(service, EwsID, "[email protected]");
string domainName = string.Empty;
string mailBoxServer = string.Empty;
string userName = string.Empty;
foreach (var item in userSettings)
switch (item.Key)
case "UserDN":
domainName = item.Value.ToString();
break;
case "InternalMailboxServer":
mailBoxServer = item.Value.ToString();
break;
case "UserDisplayName":
userName = item.Value.ToString();
break;
string entryId = GetIntiatorEntryID(domainName);
string mailboxId = GetInvitationMailboxId(mailBoxServer, domainName);
string sharedFilePath = CreateSharingMessageAttachment(folderidHex, userName, entryId, mailboxId, "[email protected]", "calendar", calendar.FolderName);
// Create a new message
EmailMessage invitationRequest = new EmailMessage(service);
invitationRequest.Subject = "I'd like to share my calendar with you";
invitationRequest.Body = "Sent by Exchange Administrator on behalf of user";
//invitationRequest.Culture = "en-US";
invitationRequest.Sensitivity = Sensitivity.Normal;
// Set a sharing specific property on the message
invitationRequest.ItemClass = "IPM.Sharing"; /* Constant Required Value [MS-ProtocolSpec] */
byte[] byteEntryId = HexStringToByteArray(entryId);
// This is the Guid of the Sharing Provider in Exchange, and it's value does not change
Guid binSharingProviderGuid = new Guid("{AEF00600-0000-0000-C000-000000000046}");
// Even though I don't think setting this property is mandatory,
// it just seemed like the right thing to do and it works so I \
// ain't messin with it!
byte[] byteSharingProviderGuid = binSharingProviderGuid.ToByteArray();
string strPRBODYHTML = "<html dir=\"ltr\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\r\n<meta name=\"GENERATOR\"
content=\"MSHTML 8.00.7601.17514\">\r\n<style id=\"owaParaStyle\">P {\r\n MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px \r\n}\r\n</style>\r\n</head>\r\n<body fPStyle=\"1\" ocsi=\"0\">\r\n<tt>\r\n<pre>SharedByUserDisplayName
(SharedByUserSmtpAddress) has invited you to view his or her Microsoft Exchange Calendar.\r\n\r\nFor instructions on how to view shared folders on Exchange, see the following article:\r\n\r\nhttp://go.microsoft.com/fwlink/?LinkId=57561\r\n\r\n*~*~*~*~*~*~*~*~*~*\r\n\r\n</pre>\r\n</tt>\r\n<div>\r\n<div
style=\"direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;\">this is a test message</div>\r\n</div>\r\n</body>\r\n</html>\r\n";
string strBODY = @"
SharedByUserDisplayName (SharedByUserSmtpAddress) has invited you to view his or
her Microsoft Exchange Calendar.
For instructions on how to view shared folders on Exchange, see the
following article:
http://go.microsoft.com/fwlink/?LinkId=57561
*~*~*~*~*~*~*~*~*~*
test body
// Convert these to hex and binary equivelants to assign to their relevant
// extended properties
string hexPRBODYHTML = ConvertStringToHex(strPRBODYHTML);
byte[] binPRBODYHTML = HexStringToByteArray(hexPRBODYHTML);
Guid PropertySetSharing = Guid.Parse("00062040-0000-0000-C000-000000000046");//constant
Guid PropertySetInternetHeaders = Guid.Parse("00020386-0000-0000-C000-000000000046");//constant
ExtendedPropertyDefinition PidLidSharingProviderGuidProperty = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A01, MapiPropertyType.CLSID);
ExtendedPropertyDefinition ConversationIdProperty = new ExtendedPropertyDefinition(0x3013, MapiPropertyType.Binary);
// Sharing Properties (in order of reference according to protocol examples in: [MS-OXSHARE])
// Additional Property Constraints
// [MS-OXSHARE] 2.2.5.2
ExtendedPropertyDefinition PidTagMessageClass = new ExtendedPropertyDefinition(0x001A, MapiPropertyType.String);
// [MS-OXSHARE] 2.2.5.1
//ExtendedPropertyDefinition PidNameContentClass = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.InternetHeaders, "Content-Class", MapiPropertyType.String);
ExtendedPropertyDefinition PidNameContentClass = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "Content-class", MapiPropertyType.String);
// Common Message Object Properties
// [MS-OXSHARE] 2.2.1
ExtendedPropertyDefinition PidTagNormalizedSubject = new ExtendedPropertyDefinition(0x0E1D, MapiPropertyType.String);
// The PidTagSubjectPrefix is a zero-length string, so I do not set it
// ExtendedPropertyDefinition PidTagSubjectPrefix = new ExtendedPropertyDefinition(0x003D, MapiPropertyType.String);
// Sharing Object Message Properties
// [MS-OXSHARE] 2.2.2.12
ExtendedPropertyDefinition PidLidSharingProviderGuid = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A01, MapiPropertyType.Binary);
// [MS-OXSHARE] 2.2.2.13
ExtendedPropertyDefinition PidNameXSharingProviderGuid = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Provider-GUID", MapiPropertyType.String);
// [MS-OXSHARE] 2.2.2.14
ExtendedPropertyDefinition PidLidSharingProviderName = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A02, MapiPropertyType.String);
// [MS-OXSHARE] 2.2.2.15
ExtendedPropertyDefinition PidNameXSharingProviderName = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Provider-Name", MapiPropertyType.String);
// [MS-OXSHARE] 2.2.2.16
ExtendedPropertyDefinition PidLidSharingProviderUrl = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A03, MapiPropertyType.String);
// [MS-OXSHARE] 2.2.2.17
ExtendedPropertyDefinition PidNameXSharingProviderUrl = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Provider-URL", MapiPropertyType.String);
// [MS-OXSHARE] 2.2.2.5
ExtendedPropertyDefinition PidLidSharingFlavor = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A18, MapiPropertyType.Integer);
// [MS-OXSHARE] 2.2.2.6
ExtendedPropertyDefinition PidNameXSharingFlavor = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Flavor", MapiPropertyType.String);
// [MS-OXSHARE] 2.2.2.1
ExtendedPropertyDefinition PidLidSharingCapabilities = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A17, MapiPropertyType.Integer);
// [MS-OXSHARE] 2.2.2.2
ExtendedPropertyDefinition PidNameXSharingCapabilities = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Capabilities", MapiPropertyType.String);
// Sections 2.3 and 2.4 are also zero-length strings, so I won't set those either
// [MS-OXSHARE] 2.2.2.3
// ExtendedPropertyDefinition PidLidSharingConfigurationUrl = new //ExtendedPropertyDefinition(PropertySetSharing, 0x8A24, MapiPropertyType.String);
// [MS-OXSHARE] 2.2.2.4
//ExtendedPropertyDefinition PidNameXSharingConfigUrl = new //ExtendedPropertyDefinition(DefaultExtendedPropertySet.InternetHeaders, "X-Sharing-Config-Url", MapiPropertyType.String);
// [MS-OXSHARE] 2.2.2.10
ExtendedPropertyDefinition PidLidSharingLocalType = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A14, MapiPropertyType.String);
// [MS-OXSHARE] 2.2.2.11
ExtendedPropertyDefinition PidNameXSharingLocalType = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Local-Type", MapiPropertyType.String);
// [MS-OXSHARE] 2.2.2.7
ExtendedPropertyDefinition PidLidSharingInitiatorEntryId = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A09, MapiPropertyType.Binary);
// [MS-OXSHARE] 2.2.2.8
ExtendedPropertyDefinition PidLidSharingInitiatorName = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A07, MapiPropertyType.String);
// [MS-OXSHARE] 2.2.2.9
ExtendedPropertyDefinition PidLidSharingInitiatorSMTP = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A08, MapiPropertyType.String);
// [MS-OXSHARE] 2.2.3.1
ExtendedPropertyDefinition PidLidSharingRemoteName = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A05, MapiPropertyType.String);
// [MS-OXSHARE] 2.2.3.2
ExtendedPropertyDefinition PidNameXSharingRemoteName = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Name", MapiPropertyType.String);
// [MS-OXSHARE] 2.2.3.5
ExtendedPropertyDefinition PidLidSharingRemoteType = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A1D, MapiPropertyType.String);
// [MS-OXSHARE] 2.2.3.6
ExtendedPropertyDefinition PidNameXSharingRemoteType = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Type", MapiPropertyType.String);
// [MS-OXSHARE] 2.2.3.7
ExtendedPropertyDefinition PidLidSharingRemoteUid = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A06, MapiPropertyType.String);
// [MS-OXSHARE] 2.2.3.8
ExtendedPropertyDefinition PidNameXSharingRemoteUid = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Uid", MapiPropertyType.String);
// [MS-OXSHARE] 2.2.3.3
ExtendedPropertyDefinition PidLidSharingRemoteStoreUid = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A48, MapiPropertyType.String);
// [MS-OXSHARE] 2.2.3.4
ExtendedPropertyDefinition PidNameXSharingRemoteStoreUid = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Store-Uid", MapiPropertyType.String);
//From troubleshooting I noticed I was missing
ExtendedPropertyDefinition PidTagPriority = new ExtendedPropertyDefinition(0x0026, MapiPropertyType.Integer);
ExtendedPropertyDefinition PidTagSensitivity = new ExtendedPropertyDefinition(0x0036, MapiPropertyType.Integer);
ExtendedPropertyDefinition PR_BODY_HTML = new ExtendedPropertyDefinition(0x1013, MapiPropertyType.Binary); //PR_BOD
ExtendedPropertyDefinition PR_BODY = new ExtendedPropertyDefinition(0x1000, MapiPropertyType.String);
ExtendedPropertyDefinition RecipientReassignmentProhibited = new ExtendedPropertyDefinition(0x002b, MapiPropertyType.Boolean);
// Section 2.2.1
invitationRequest.SetExtendedProperty(PidTagNormalizedSubject, "I'd like to share my calendar with you"); /* Constant Required Value [MS-OXSHARE] 2.2.1 */
//invitationRequest.SetExtendedProperty(PidTagSubjectPrefix, String.Empty); /* Constant Required Value [MS-OXSHARE] 2.2.1 */
// Section 2.2.2
invitationRequest.SetExtendedProperty(PidLidSharingCapabilities, 0x40220); /* value for Special Folders */
invitationRequest.SetExtendedProperty(PidNameXSharingCapabilities, "40220"); /* Test representation of SharingCapabilities value */
//invitationRequest.SetExtendedProperty(PidLidSharingConfigurationUrl, String.Empty); /* Zero-Length String [MS-OXSHARE] 2.2.2.3 */
//invitationRequest.SetExtendedProperty(PidNameXSharingConfigUrl, String.Empty); /* Zero-Length String [MS-OXSHARE] 2.2.2.4 */
invitationRequest.SetExtendedProperty(PidLidSharingFlavor, 0x20310); /* Indicates Invitation for a special folder [MS-OXSHARE] 2.2.2.5 */
invitationRequest.SetExtendedProperty(PidNameXSharingFlavor, "20310"); /* Text representation of SharingFlavor value [MS-OXSHARE] 2.2.2.6 */
invitationRequest.SetExtendedProperty(PidLidSharingInitiatorEntryId, byteEntryId); /* Value from the Initiator/EntryId value in the Sharing Message attachment .xml document */
invitationRequest.SetExtendedProperty(PidLidSharingInitiatorSMTP, "[email protected]"); /* Value from Initiator/Smtp Address in the Sharing message attachment .xml document */
invitationRequest.SetExtendedProperty(PidLidSharingInitiatorName, "User1"); /* Value from Initiator/Name Address in the Sharing message attachment .xml document */
invitationRequest.SetExtendedProperty(PidLidSharingLocalType, "IPF.Appointment"); /* MUST be set to PidTagContainerClass of folder to be shared */
invitationRequest.SetExtendedProperty(PidNameXSharingLocalType, "IPF.Appointment"); /* MUST be set to same value as PidLidSharingLocalType */
invitationRequest.SetExtendedProperty(PidLidSharingProviderGuid, byteSharingProviderGuid); /* Constant Required Value [MS-OXSHARE] 2.2.2.12 */
invitationRequest.SetExtendedProperty(PidNameXSharingProviderGuid, "AEF0060000000000C000000000000046"); /* Constant Required Value [MS-OXSHARE] 2.2.2.13 */
invitationRequest.SetExtendedProperty(PidLidSharingProviderName, "Microsoft Exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.14 */
invitationRequest.SetExtendedProperty(PidNameXSharingProviderName, "Microsoft Exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.15] */
invitationRequest.SetExtendedProperty(PidLidSharingProviderUrl, "http://www.microsoft.com/exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.16 */
invitationRequest.SetExtendedProperty(PidNameXSharingProviderUrl, "http://www.microsoft.com/exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.17 */
// Section 2.2.3
invitationRequest.SetExtendedProperty(PidLidSharingRemoteName, calendar.FolderName); /* MUST be set to PidTagDisplayName of the folder being shared */
invitationRequest.SetExtendedProperty(PidNameXSharingRemoteName, calendar.FolderName); /* MUST be set to same value as PidLidSharingRemoteName */
invitationRequest.SetExtendedProperty(PidLidSharingRemoteStoreUid, mailboxId); /* Must be set to PidTagStoreEntryId of the folder being shared */
invitationRequest.SetExtendedProperty(PidNameXSharingRemoteStoreUid, mailboxId); /* MUST be set to same value as PidLidSharingRemoteStoreUid */
invitationRequest.SetExtendedProperty(PidLidSharingRemoteType, "IPF.Appointment"); /* Constant Required Value [MS-OXSHARE] 2.2.3.5 */
invitationRequest.SetExtendedProperty(PidNameXSharingRemoteType, "IPF.Appointment"); /* Constant Required Value [MS-OXSHARE] 2.2.3.6 */
invitationRequest.SetExtendedProperty(PidLidSharingRemoteUid, folderidHex); /* MUST be set to PidTagEntryId of folder being shared */
invitationRequest.SetExtendedProperty(PidNameXSharingRemoteUid, folderidHex); /* Must be set to same value as PidLidSharingRemoteUid */
// Section 2.2.5
invitationRequest.SetExtendedProperty(PidNameContentClass, "Sharing"); /* Constant Required Value [MS-ProtocolSpec] */
invitationRequest.SetExtendedProperty(PidTagMessageClass, "IPM.Sharing"); /* Constant Required Value [MS-ProtocolSpec] */
// ********* ADDITIONAL MAPPED PROPERTIES IM FINDING AS I TROUBLESHOOT ********************** //
invitationRequest.SetExtendedProperty(PidTagPriority, 0); /* From troubleshooting I'm just trying to match up values that were missing */
invitationRequest.SetExtendedProperty(PidTagSensitivity, 0); /* From troubleshooting as well */
invitationRequest.SetExtendedProperty(PR_BODY_HTML, binPRBODYHTML); /* From troubleshooting OWA error pointing to serializing HTML failing */
invitationRequest.SetExtendedProperty(PR_BODY, strBODY);
invitationRequest.SetExtendedProperty(RecipientReassignmentProhibited, true); /* Because it seemed like a good idea */
// Add a file attachment by using a stream
// We need to do the following in order to prevent 3 extra bytes from being prepended to the attachment
string sharMetadata = File.ReadAllText(sharedFilePath, Encoding.ASCII);
byte[] fileContents;
UTF8Encoding encoding = new System.Text.UTF8Encoding();
fileContents = encoding.GetBytes(sharMetadata);
//fileContents = File.ReadAllBytes(sharedFilePath);
//// fileContents is a Stream object that represents the content of the file to attach.
invitationRequest.Attachments.AddFileAttachment("sharing_metadata.xml", fileContents);
////invitationRequest.Attachments.AddFileAttachment(sharedFilePath);
//// This is where we set those "special" headers and other pertinent
//// information I noted in Part 1 of this series...
//Attachment thisAttachment = invitationRequest.Attachments[0];
//thisAttachment.ContentType = "application/x-sharing-metadata-xml";
//thisAttachment.Name = "sharing_metadata.xml";
//thisAttachment.IsInline = false;
// Add recipient info and send message
invitationRequest.ToRecipients.Add(new EmailAddress() { Address = "[email protected]" });
invitationRequest.SendAndSaveCopy();
// I always end my methods by returning the EWS
// impersonated user to null to clean up
service.ImpersonatedUserId = null;
catch (Exception ex)
public String GetConvertedEWSIDinHex(ExchangeService esb, String sID, String strSMTPAdd)
// Create a request to convert identifiers.
AlternateId objAltID = new AlternateId();
objAltID.Format = IdFormat.EwsId;
objAltID.Mailbox = strSMTPAdd;
objAltID.UniqueId = sID;
//Convert PR_ENTRYID identifier format to an EWS identifier.
AlternateIdBase objAltIDBase = esb.ConvertId(objAltID, IdFormat.HexEntryId);
AlternateId objAltIDResp = (AlternateId)objAltIDBase;
return objAltIDResp.UniqueId.ToString();
public String GetInvitationMailboxId(string mailBoxServer, string domainName)
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
service.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "[email protected]");
// Generate The Store Entry Id for the impersonated user
StringBuilder MailboxIDPointer = new StringBuilder();
string fqdn = mailBoxServer;
string legacyDN = domainName;
MailboxIDPointer.Append("00000000"); /* Flags */
MailboxIDPointer.Append("38A1BB1005E5101AA1BB08002B2A56C2"); /* ProviderUID */
MailboxIDPointer.Append("00"); /* Version */
MailboxIDPointer.Append("00"); /* Flag */
MailboxIDPointer.Append("454D534D44422E444C4C00000000"); /* DLLFileName */
MailboxIDPointer.Append("00000000"); /* Wrapped Flags */
MailboxIDPointer.Append("1B55FA20AA6611CD9BC800AA002FC45A"); /* WrappedProvider UID (Mailbox Store Object) */
MailboxIDPointer.Append("0C000000"); /* Wrapped Type (Mailbox Store) */
MailboxIDPointer.Append(ConvertStringToHex(fqdn)); /* ServerShortname (FQDN) */
MailboxIDPointer.Append("00"); /* termination bit */
MailboxIDPointer.Append(ConvertStringToHex(legacyDN)); /* Returns the userDN of the impersonated user */
MailboxIDPointer.Append("00"); /* terminator bit */
service.ImpersonatedUserId = null;
return MailboxIDPointer.ToString();
static bool RedirectionUrlValidationCallback(String redirectionUrl)
bool redirectionValidated = false;
if (redirectionUrl.Equals("https://SampleUrl/autodiscover/autodiscover.xml"))
redirectionValidated = true;
return redirectionValidated;
public String GetIntiatorEntryID(string domainName)
String result = String.Empty;
//// Bind to EWS
//ExchangeService service = ExchangeConnection.ExchangeService();
//service.ImpersonatedUserId =
//new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "[email protected]");
//// Get LegacyDN Using the function above this one
string sharedByLegacyDN = domainName;
// A conversion function from earlier
string legacyDNinHex = ConvertStringToHex(sharedByLegacyDN);
StringBuilder addBookEntryId = new StringBuilder();
addBookEntryId.Append("00000000"); /* Flags */
addBookEntryId.Append("DCA740C8C042101AB4B908002B2FE182"); /* ProviderUID */
addBookEntryId.Append("01000000"); /* Version */
addBookEntryId.Append("00000000"); /* Type - 00 00 00 00 = Local Mail User */
addBookEntryId.Append(legacyDNinHex); /* Returns the userDN of the impersonated user */
addBookEntryId.Append("00"); /* terminator bit */
result = addBookEntryId.ToString();
//service.ImpersonatedUserId = null;
return result;
public string ConvertStringToHex(string input)
// Take our input and break it into an array
char[] arrInput = input.ToCharArray();
String result = String.Empty;
// For each set of characters
foreach (char element in arrInput)
if (String.IsNullOrEmpty(result))
result = String.Format("{0:X2}", Convert.ToUInt16(element)).ToString();
else
result += String.Format("{0:X2}", Convert.ToUInt16(element)).ToString();
return result.ToString();
public string CreateSharingMessageAttachment(string folderid, string userSharing, string userSharingEntryID, string invitationMailboxID, string userSharedTo, string dataType, string calendarName)
XmlDocument sharedMetadataXML = new XmlDocument();
string sharedMetaDataFilePath = string.Empty;
try
// Create a String that contains our new sharing_metadata.xml file
StringBuilder metadataString = new StringBuilder("<?xml version=\"1.0\"?>");
metadataString.Append("<SharingMessage xmlns=\"http://schemas.microsoft.com/sharing/2008\">");
metadataString.Append("<DataType>" + dataType + "</DataType>");
metadataString.Append("<Initiator>");
metadataString.Append("<Name>" + userSharing + "</Name>");
metadataString.Append("<SmtpAddress>" + "[email protected]" + "</SmtpAddress><EntryId>" + userSharingEntryID.Trim());
metadataString.Append("</EntryId>");
metadataString.Append("</Initiator>");
metadataString.Append("<Invitation>");
metadataString.Append("<Title>" + calendarName + "</Title>");
metadataString.Append("<Providers>");
metadataString.Append("<Provider Type=\"ms-exchange-internal\" TargetRecipients=\"" + userSharedTo + "\">");
metadataString.Append("<FolderId xmlns=\"http://schemas.microsoft.com/exchange/sharing/2008\">");
metadataString.Append(folderid);
metadataString.Append("</FolderId>");
metadataString.Append("<MailboxId xmlns=\"http://schemas.microsoft.com/exchange/sharing/2008\">");
metadataString.Append(invitationMailboxID);
metadataString.Append("</MailboxId>");
metadataString.Append("</Provider>");
metadataString.Append("</Providers>");
metadataString.Append("</Invitation>");
metadataString.Append("</SharingMessage>");
sharedMetadataXML.LoadXml(metadataString.ToString());
string tempPath = System.IO.Path.GetTempPath();
sharedMetaDataFilePath = tempPath + "sharing_metadata.xml";
sharedMetadataXML.Save(sharedMetaDataFilePath);
catch (Exception eg)
throw eg;
return sharedMetaDataFilePath;
public Dictionary<string, string> GetUserSettings(AutodiscoverService autodiscoverService)
GetUserSettingsResponse userresponse = autodiscoverService.GetUserSettings(
"[email protected]",
UserSettingName.UserDisplayName,
UserSettingName.InternalMailboxServerDN,
UserSettingName.UserDN
Dictionary<string, string> myUserSettings = new Dictionary<string, string>();
foreach (KeyValuePair<UserSettingName, Object> usersetting in userresponse.Settings)
if (usersetting.Key.ToString() == "InternalMailboxServerDN")
int lastIndexOfEqual = usersetting.Value.ToString().LastIndexOf("=");
string subString = usersetting.Value.ToString().Substring(lastIndexOfEqual + 1);
string value = subString;
myUserSettings.Add("InternalMailboxServer", value.ToString());
if (usersetting.Key.ToString() == "UserDisplayName")
string[] arrResult = usersetting.Value.ToString().Split('.');
myUserSettings.Add("UserDisplayName", arrResult[0].ToString());
if (usersetting.Key.ToString() == "UserDN")
string[] arrResult = usersetting.Value.ToString().Split('.');
myUserSettings.Add("UserDN", arrResult[0].ToString());
return myUserSettings;
private static byte[] HexStringToByteArray(string input)
byte[] Bytes;
int ByteLength;
string HexValue = "\x0\x1\x2\x3\x4\x5\x6\x7\x8\x9|||||||\xA\xB\xC\xD\xE\xF";
ByteLength = input.Length / 2;
Bytes = new byte[ByteLength];
for (int x = 0, i = 0; i < input.Length; i += 2, x += 1)
Bytes[x] = (byte)(HexValue[Char.ToUpper(input[i + 0]) - '0'] << 4);
Bytes[x] |= (byte)(HexValue[Char.ToUpper(input[i + 1]) - '0']);
return Bytes;
am i missing anything
any help is appreciated
Thanks in advance -
How to get the url of a document in content management?
Hello,
I have used API 'SKWF_PHIO_CONTENT_URL_GET to get the url of a file in CRM content management. But when I tried to open this url in explorer got error message "SSF error: Decoding not possible". Could any one please help me to resolve this problem.
Thanks
NishaThanks for replying - unfortunately, there is not much
support on these forums.
I wish there was some way to emulate the mouse from
Javascript to click the play, pause, and slider buttons... but one
would't even know, programmatically, the location on screen of the
play, pause, and slider buttons.
quote:
Originally posted by:
davexnet
You'll notice that questions like this don't get answered on
this
forum. The Flash player has a philosophy that skews the power
over almost everything about it to the content providers,
and precious little control, if at all, to the client player.
It's a crappy situation - I use Flashblock in Firefox and
only view the
content *I* want to see.
It works for me, particularly since I'm using an older
(slower )
computer that really gets bogged down by aggressive Flash
content. -
Let's see if we can get a thread going in regards to Oracle's << apparent >> intent to cease bundling iFS with the
Oracle 9i Database Server. In a statement shared with me just a little bit ago, Oracle states that licensing implications
for current database customers using what is to be called << in 9.0.3 >> the Oracle Content Management SDK is to be
determined...
Bunk! Now that they have people roped in, they're going to break the API out, and license << big $$$$, no doubt >>
it separately! Go Micro$oft! errrr... oracle...Robert,
I would say that there are pro's and con's to both arguments. If you want to make use of iFS with ID, Web Cache etc then you're going to need a copy of 9iAS anyway and as iFS becomes more integrated with various applications then you can see where Oracle is coming from.
If you are a software house developing solutions based on iFS then this makes the licensing issue much cleaner and simpler for clients to understand (something which we have come up against as iFS is availabe in 9iDB and 9iAS). It also means that iFS should receive greater exposure within Oracle as the account managers are more likely to do something with it as it is a revenue generator.
Naturally the other side is if you are developing an application or just using iFS in house then having to purchase 9iAS can seem like unwanted overhead. I think over the coming months we are likely to see iFS more tightly integrated with iAS so eventually to make use of that additional functionality you will need a copy of iAS. I guess it depends what you are doing with it as the API is likely to be packaged in a similar way as other dev kits.
Regards,
Bernard Wright
Technical Director
Serengeti Systems -
Oracle Payables Integration With Documentum Content Managment System
Hi there,
I'm working for a customer who has the requirement to add "attachments" to invoices in Oracle Payables. The attached documents will not be stored in Oracle, but will be links to documents stored in the Documentum content management system. Clicking on the link will retrieve the document and display it.
The problem is I am a complete novice when it comes to developing for Oracle Payables. Documentum provides an extensive java API that I have a lot of experience using but can I get at that from within Payables?
Can anyone point me at the correct documentation/websites to get me going?
Many Thanks
PaulYou can attach a URL to an invoice using standard attachments, just query up an existing invoice and click on the "paperclip" attachments icon in the toolbar, enter the sequence, category, description and enter "Web Page" as the data type, then put the URL in the File or URL field.
You could also do the above steps automatedly via PL/SQL (or Java) by calling the appropriate FND attached documents API to insert the data into the required tables.
Gareth
Blog: http://garethroberts.blogspot.com
Web: http://www.virtuate.com -
Any code samples for inputting content into content manager 8.1?
Does anybody know where to find code samples of adding content to the Content Manager
via the Java API?
The only code I can find is the "Content Manager Example Portlet" and it is 7.0,
not 8.1.
It's not clear from the documentation what the Repository and Path are supposed
to be named. Perhaps we had a working example, this might help.
Thanks
DaveDoes anybody know where to find code samples of adding content to the Content Manager
via the Java API?
The only code I can find is the "Content Manager Example Portlet" and it is 7.0,
not 8.1.
It's not clear from the documentation what the Repository and Path are supposed
to be named. Perhaps we had a working example, this might help.
Thanks
Dave -
Answer: 814 content management gets ConcurrentModificationException
I wanted to get this into this news group for others to find.
Solution: Open a ticket and get patch patch_CR211051_81SP4
Problem:
WLP 814 using content management P13N tags or APIs. While your portal is up and users have browsed content, run the portalAdmin--content update content, or use load_cm_data.sh and you get exception.
FYI I believe this bug will most likely happen on SMP boxes. IE you'll not likely see this on a single CPU box. Just my guess based on experience.
<Jan 21, 2005 3:55:13 PM EST> <Info> <EJB> <BEA-010051> <EJB Exception occurred during invocation from home: [email protected]51
threw exception: java.util.ConcurrentModificationException
java.util.ConcurrentModificationException
at java.util.Hashtable$Enumerator.next()Ljava.lang.Object;(Unknown Source)
at com.bea.p13n.cache.CacheImpl.createSet(Z)Ljava.util.Set;(CacheImpl.java:764)
at com.bea.p13n.cache.CacheImpl.keySet()Ljava.util.Set;(CacheImpl.java:350)
at com.bea.content.manager.internal.CacheHelper.flushAllBinaryCacheEntries(Ljava.lang.String;Ljava.lang.String;)V(CacheHelper.java:482)
at com.bea.content.manager.internal.NodeOpsBean.updateProperties(Lcom.bea.content.ID;[Lcom.bea.content.Property;)Lcom.bea.content.Node;(NodeOpsBean.java:1391)
at com.bea.content.manager.internal.NodeOpsEJB_e40s0j_ELOImpl.updateProperties(Lcom.bea.content.ID;[Lcom.bea.content.Property;)Lcom.bea.content.Node;(NodeOpsEJB_e40s0j_iSync automatically takes the newest changes to data on your devices and applies them to all other devices when you sync.
There is no manual override for similar content when syncing your phone. The ability to select data on one device or another appears on an initial sync when you choose to 'Merge' the data on the device and on the Mac. Doing this is often unsuccessful, so for an initial sync its better to start with a fully up-to-date Mac Address Book and a completely empty phone.
Have you renamed the telephone number fields in the Mac Address Book? If you have, that can cause multiple phone numbers of the same type to appear. However Sony Ericsson phones only support one number of each type:
work
mobile
home
fax
other
If your fields in the Mac's Address Book are named anything other than this, set them back. Then make sure your Mac's Address Book is fully up-to-date, back it up, then click "Reset Sync History..." in iSync Preferences and re-sync your phone.
.Mac Sync is separate to iSync and is for syncing Mac-to-Mac, so you can ignore any references to .Mac if you're just syncing your phone.
For further iSync Tips see my web-site here:
http://www.feisar.com/isync_tips.html -
Hi,
I need to retrieve some data from content management in my jpf file. How can I do that? Appreciate your reply.
Thanks,
mxa1097Look at the APIs for com.bea.content and com.bea.content.manager.
You would probably start with
com.bea.content.manager.RepositoryManagerFactory.connect(getSession()),
e.g.:
RepositoryManager rMgr =
RepositoryManagerFactory.connect(getSession()).create();
NodeOps nodeOps = rMgr.getNodeOps();
SearchOps searchOps = rMgr.getSearchOps();
The code-completion in workshop and javadoc (hit f1 while on class or
method to open the javadoc) should help out. NodeOps has a variety of
method for getting individual nodes and their children, plus
create/update/delete methods for non-lifecycle repository.
There's also an example of doing a content search via the APIs at
http://e-docs.bea.com/wlp/docs81/whitepapers/p13n/body.html#1072362.
Greg
Mona Khanapurkar wrote:
Hi,
I need to retrieve some data from content management in my jpf file. How can I do that? Appreciate your reply.
Thanks,
mxa1097 -
Reading Images from DB2 content Manager
Has anybody have read images from IBM db2 content manager using oracel forms.
any links will be helpfu;
or any links to how to make windows API calls in forms 5.0.OK, I found Greg's reply and that fixed it, once I played with it a bit.
"Cory McGinnis" <[email protected]> wrote:
>
I am displaying an html page from a <cm:select> but the images do not
display.
I have set up the dmsbase directory as per the samplePortal, and loaded
the content.
The HTML displays, but with errors for the images.
Here's the select from the portlet:
<cm:select contentHome="<%=ContentHelper.DEF_CONTENT_MANAGER_HOME%>"
query="type='page'"
id="textDocs"/>
<es:forEachInArray array="<%=textDocs%>" id="aTextDoc" type="com.bea.p13n.content.Content">
<p><cm:printDoc id="aTextDoc" failOnError="true" /></p>
</es:forEachInArray> -
Get the latest approved version of a content management resource
Hi I am using EP 6 with Content management.
I my application I need to get resources form content management, approval process is enabled for the content items.
I use this code
RID rid = RID.getRID(path);
if (rid != null) {
try {
resource = rf.getResource(rid, context);
} catch (ResourceException e1) {
//errorhandling
where rf is a com.sapportals.wcm.repository.IResourceFactory
created from a service user and a service context
which work fine, When the resource has been approved.
however if I change the specified content Item and do not approve it, the above code returns null as resource.
I would expect the api to return the latest approved version of the resource.
Have I misunderstood soemthing here or should I use another API?I solved my problem...
first of all.
Versioning was enabled for the folder but apparently it didnt work so i disabled it and enabled it again. Then I got the correct reource instead of null.
second thing
later in mycode I used this to get the path of the resource
resource.getRID().getPath();
but this gives the path to where the version of the document can be found... something like /documents/~System/xx/xxxxx/xxxx
where x is numbers
after doing a little debugging I found out that
resource.getAccessRID().getPath()
returns the path to where in CM the resource is stored.
I hope My experience here can help others.
I am glad that I solved my problem, but I find it extremely worrying that some settings in CM apparently stops working without any apparent reason.
We have experienced this with other properties like Manual Ordering, Approval process, have any one else had these problems and found the cause then I would like to hear about it -
I want to fetch all mails in the Inbox folder using EWS Managed API and store them as .eml.
I can store file once I get the file content as a byte[] will
not be difficult, as I can do:
File.WriteAllBytes("c:\\mails\\"+mail.Subject+".eml",content);
The problem will be to fetch (1) all mails with (2)
all headers (like from, to, subject) (I am keeping information of those values of from, to and
other properties somewhere else, so I need them too) and (3)byte[]
EmailMessage.MimeContent.Content. Actually I am lacking understanding of
Microsoft.Exchange.WebServices.Data.ItemView,
Microsoft.Exchange.WebServices.Data.BasePropertySet and
Microsoft.Exchange.WebServices.Data.ItemSchema
thats why I am finding it difficult.
My primary code is:
When I create PropertySet as
follows:
PropertySet properties = new PropertySet(BasePropertySet.FirstClassProperties, ItemSchema.MimeContent);
I get following exception:
The property MimeContent can't be used in FindItem requests.
I dont understand
(Q1) What these ItemSchema and BasePropertySet are
(Q2) And how we are supposed to use them
So I removed ItemSchema.MimeContent:
PropertySet properties = new PropertySet(BasePropertySet.FirstClassProperties);
I wrote simple following code to get all mails in inbox:
ItemView view = new ItemView(50);
view.PropertySet = properties;
FindItemsResults<Item> findResults;
List<EmailMessage> emails = new List<EmailMessage>();
do
findResults = service.FindItems(WellKnownFolderName.Inbox, view);
foreach (var item in findResults.Items)
emails.Add((EmailMessage)item);
Console.WriteLine("Loop");
view.Offset = 50;
while (findResults.MoreAvailable);
Above I kept page size of ItemView to
50, to retrieve no more than 50 mails at a time, and then offsetting it by 50 to get next 50 mails if there are any. However it goes in infinite loop and continuously prints Loop on
console. So I must be understanding pagesize and offset wrong.
I want to understand
(Q3) what pagesize, offset and offsetbasepoint in ItemView constructor
means
(Q4) how they behave and
(Q5) how to use them to retrieve all mails in the inbox
I didnt found any article online nicely explaining these but just giving code samples. Will appreciate question-wise explanation despite it may turn long.1) With FindItems it will only return a subset of Item properties see
http://msdn.microsoft.com/en-us/library/bb508824(v=exchg.80).aspx for a list and explanation. To get the mime content you need to use a GetItem (or Load) I would suggest you read
http://blogs.msdn.com/b/exchangedev/archive/2010/03/16/loading-properties-for-multiple-items-with-one-call-to-exchange-web-services.aspx which also covers of paging as well.
3) offset is from the base your setting the offset to 50 each time which means your only going to get the 50 items from the offset of 50 which just creates an infinite loop. You should use
view.Offset
= +50;
to increment the Offset although it safer to use
view.Offset += findResults.Items.Count;
which increments the offset based on the result of the last FindItems operation.
5) try something like
ItemView iv = new ItemView(100, 0);
FindItemsResults<Item> firesults = null;
PropertySet psPropSet = new PropertySet(BasePropertySet.IdOnly);
iv.PropertySet = psPropSet;
PropertySet itItemPropSet = new PropertySet(BasePropertySet.IdOnly) { ItemSchema.MimeContent, ItemSchema.Subject, EmailMessageSchema.From };
do
firesults = service.FindItems(WellKnownFolderName.Inbox, iv);
service.LoadPropertiesForItems(firesults.Items, itItemPropSet);
foreach(Item itItem in firesults){
Object MimeContent = null;
if(itItem.TryGetProperty(ItemSchema.MimeContent,out MimeContent)){
Console.WriteLine("Processing : " + itItem.Subject);
iv.Offset += firesults.Items.Count;
} while (firesults.MoreAvailable);
Cheers
Glen
.Offset += fiFitems.Items.Count; -
ConversationId property vs ConversationIndex property in Exchange Web Services managed API
EWS Managed API have two properties:ConversaionId and ConversationIndex
What is the difference between them? I guess ConversationId is
the the ConversationIndex of
the first mail in the conversation which is essentially of 22 bytes, while ConversationIndex is
the index of that particular reply in the conversation thread, essentially of 22 bytes + multiples of 5 bytes for each reply in the conversation. Is it like that?
Also ConversationId is
accessible only with Exchange Server 2010 onwards. So cant we access ConversationId in
the Exchange Server 2007?I just found this thread that indicates that you can use an extended property definition to access the ConversationId in Exchange 2007. Very smart!
http://stackoverflow.com/questions/7487570/implementing-outlook-2010s-group-by-conversation-using-ews-and-exchange-2007
Henning's answer:
You can fetch the ConversationId and the ConversationIndex via extended properties:
private static readonly ExtendedPropertyDefinition ConversationIdProperty = new ExtendedPropertyDefinition(0x3013, MapiPropertyType.Binary);
private static readonly ExtendedPropertyDefinition ConversationIndexProperty = new ExtendedPropertyDefinition(0x0071, MapiPropertyType.Binary);
var items = service.FindItems(WellKnownFolderName.Inbox, new ItemView(512) { PropertySet = new PropertySet(BasePropertySet.FirstClassProperties,
ConversationIdProperty, ConversationIndexProperty)});
Both are binary properties. Their content is described in great detail here:
[MS-OXOMSG]: E-Mail Object Protocol Specification, section 2.2.1.2 and 2.2.1.3.
The properties themselves are defined in
[MS-OXPROPS]: Exchange Server Protocols Master Property List.
Maybe you are looking for
-
Alternate table of AP_INVOICE_LINES_ALL in 11i
hi 2 all I have developed Supplier Statement of Account report in oracle apps r12 and use AP_INVOICE_LINES_ALL table. it running fine in R12 , but when i run in 11i , compiler raised error on AP_INVOICE_LINES_ALL table , b/c this table is not availab
-
Hi All, Could someone suggest me is there a report which shows the issues against stocks in the inventory which will help us plan Min/Max.Other thing can anyone tell me how to upload budgets in inv and is there any option of putting in both quantity
-
Reversing whole TDS amount while Advance adjustment in F-54
Dear Experts, Need all your help to resolve my problem related to TDS deduction against advance payment and invoice. TDS deduction against Advance payment doc no : 1500004435 PK Account Amount 50 BANK A/c 9900-
-
Want to take pictures w/ N95 8gb while cycling (Sp...
I see people ask about a bike mount but i'm more interested in an accessory that would let me take pictures w/ the phone while I'm riding, but take away my worry of dropping it. If it mounts too, that would be great. Any advice? I have a Nokia N95 8
-
I'm trying to buy something on the App Store but I don't remember my Security questions answers what can I do