exchange-test-server
The test server that implement the EWS API
Install
$ npm install --save exchange-test-server
Usage
start the test server
server = serverstart port: 3000-> consolelog 'server listen on localhost:3000'
start the test server and send the SOAP request
Server = require 'exchange-test-server'Builder = require 'libxmljs-builder'http = require 'http'NS = NS_SOAP: 'soap' NS_TYPES: 't' NS_MESSAGES: 'm' NAMESPACES: soap: 'http://schemas.xmlsoap.org/soap/envelope/' t: 'http://schemas.microsoft.com/exchange/services/2006/types' m: 'http://schemas.microsoft.com/exchange/services/2006/messages' NSNS_TYPESNSNS_MESSAGES : @builder = @builderdefineNS NSNAMESPACES @builderrootNS NSNS_SOAP'Envelope' buildernodeNS NSNS_SOAP'Body'bodyCallback : @_build buildernodeNS NS_Mactioncallback : folderIds = folderIdsunless ArrayisArrayfolderIds buildernodeNS NS_M'FolderIds' @buildDistinguishFolderIdbuilderfolderId for folderId in folderIds : buildernodeNS NS_T'DistinguishedFolderId'Id: folderId : @_buildAction 'GetFolder' buildernodeNS NS_M'FolderShape' buildernodeNS NS_T'BaseShape''Default' @buildFolderIdsbuilderfolderIds dbPath = require'path'resolve__dirname'data/db.sqlite'server = serverstart dbPath: dbPath-> consolelog 'server start' config = port: 3000method: 'POST'path: '/EWS/Exchange.asmx' headers: 'Content-Type': 'text/xml' req = httprequest config consolelog 'Done' serverclose reqend build'inbox'toString
API
(Coming soon)
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using gulp.
License
Copyright (c) 2015 liuxiong. Licensed under the MIT license.