ews-javascript-api
ews-javascript-api copied to clipboard
string of search filter need to be xml encoded, otherwise it will cause SoapFault
trafficstars
var msgid_filter = new ews.SearchFilter.IsEqualTo(ews.EmailMessageSchema.InternetMessageId, "<[email protected]>");
Above filter will cause below error:
Element: Violation - Please report example of this operation to ews-javascript-api repo to improve SoapFault parsing
errors exist
SoapFaultDetails {
faultCode: 'a:ErrorSchemaValidation',
faultString:
{ 'xml:lang': 'en-US',
faultstring: 'The request failed schema validation: \'<\', hexadecimal value 0x3C, is an invalid attribute character. Line 1, position 709.' },
faultActor: null,
responseCode: 355,
message: 'The request failed schema validation.',
errorCode: 0,
exceptionType: null,
lineNumber: 1,
positionWithinLine: 709,
errorDetails:
DictionaryWithStringKey {
keys: [ 'Violation' ],
keysToObjs: { Violation: 'Violation' },
objects: { Violation: '\'<\', hexadecimal value 0x3C, is an invalid attribute character. Line 1, position 709.' },
keyPicker: [Function] } }
After changed to xml encoded string, it works.
var msgid_filter = new ews.SearchFilter.IsEqualTo(ews.EmailMessageSchema.InternetMessageId, "<[email protected]>");
I looked into official code (snapshot I am porting from), looks like it is expected to be normalized string.
I will look into this later around 1.1 or 1.2 update