Skip to content

string of search filter need to be xml encoded, otherwise it will cause SoapFault #97

@kingcpro

Description

@kingcpro

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, "&lt;[email protected]&gt;");

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions