We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Issue with EWSClient.CreateAppointment (4.6.0)

I have a bit of code that can save a newly created MapiMessage to disk as an appointment (because it IS an appointment), and recast it:

Appointment ConvertMapiMessageToAppointment(MapiMessage mapiMessage)
{
var mapiCalendar = (MapiCalendar)mapiMessage.ToMapiMessageItem();
using (var ms = new MemoryStream())
{
mapiCalendar.Save(ms);
ms.Position = 0;
var appointment = Appointment.Load(ms);
return appointment;
}
}

This works very well for the most part, as long as I don’t try to create that appointment in EWS, because the application will generate an exception.

Alternatively, if I use this bit of code to make an appointment:

Appointment appointment = new Appointment(
“Meeting Room 3 at Office Headquarters”, // Location
“Monthly Meeting”, // Summary
“Please confirm your availability.”, // Description
new DateTime(2011, 2, 8, 13, 0, 0), // Start date
new DateTime(2011, 2, 8, 14, 0, 0), // End date
"from@domain.com", // Organizer
"attendees@domain.com"); // Attendees

…instead of loading<!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val="–"/>
<m:smallFrac m:val=“off”/>
<m:dispDef/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>
</m:mathPr></w:WordDocument>
<![endif]–><!–[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Calibri","sans-serif";}

<![endif]–> it from disk, I can create this one in EWS with no problems.

I have included a sample appointment and sample code to demonstrate the issue.

Hi Sevag,

I have analyzed your provided sample MSG file and came to know that it is an appointment that has no organizer. Could you please set the sender and attendees after loading the MSG file and then try again creating the appointment? Please let us know your feedback for further assistance.

Hi,

I have gone through the MSG file and it does have an organizer - if I double-click the sample I sent you as well, it shows there is an organizer (see attached screenshot). In any case, once Aspose loads this from disk, the organizer becomes null (see attached screenshot) and if I attempt to add an organizer at this point, it generates an exception (see attached screenshot).

Thank you.

Hi Sevag,


I have used your sample code to test the issue by using my own exchange account credentials. It is observed that no exception is raised while creating the appointment on exchange.

However, if I use your code without any change i.e. using your test account credentials, it raises exception while calling function “EWSClient.GetEWSClient()”. It seems that there is some issue with the credentials, so please check the credentials again and provide us the working credentials to re-produce the issue and provide assistance.