Advertisement
Guest User

Untitled

a guest
Jun 2nd, 2016
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.82 KB | None | 0 0
  1. var ews = Meteor.npmRequire('node-ews');
  2.  
  3. var username = 'administrator@exch2013.local';
  4. var password = 'Pa$$w0rd';
  5. var host = '192.168.50.192';
  6. process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
  7.  
  8. ews.ignoreSSL = true;
  9.  
  10. ews.auth(username, password, host);
  11.  
  12. ews.run('GetFolder',
  13. {
  14. body: {
  15.  
  16. FolderShape: {
  17. BaseShape: 'Default'
  18. },
  19. FolderIds: {
  20. DistinguishedFolderId: {
  21. attributes: {
  22. Id: 'inbox'
  23. }
  24. }
  25. }
  26. },
  27. headers: {
  28. 'http://schemas.microsoft.com/exchange/services/2006/types': [{
  29. RequestServerVersion: {
  30. attributes: {
  31. Version: 'Exchange2013'
  32. }
  33. }
  34. }]
  35. }
  36. }, function(err, result) {
  37. console.log("Here is the result");
  38. console.log(JSON.stringify(result, null, 2));
  39. console.log("==========================================================");
  40. console.log("Here is error");
  41. console.log(JSON.stringify(err, null, 2));
  42. console.log("==========================================================");
  43. }
  44. );
  45.  
  46. {
  47. "root": {
  48. "Envelope": {
  49. "Body": {
  50. "Fault": {
  51. "faultcode": "a:ErrorSchemaValidation",
  52. "faultstring": {
  53. "attributes": {
  54. "xml:lang": "en-US"
  55. },
  56. "$value": "The request failed schema validation: The element 'GetFolder' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages' has invalid child element 'body' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages'. List of possible elements expected: 'FolderShape' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages'."
  57. },
  58. "detail": {
  59. "ResponseCode": "ErrorSchemaValidation",
  60. "Message": "The request failed schema validation.",
  61. "MessageXml": {
  62. "LineNumber": "1",
  63. "LinePosition": "478",
  64. "Violation": "The element 'GetFolder' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages' has invalid child element 'body' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages'. List of possible elements expected: 'FolderShape' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages'."
  65. }
  66. }
  67. }
  68. }
  69. }
  70. },
  71. "response": {
  72. "statusCode": 500,
  73. "body": "<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode xmlns:a="http://schemas.microsoft.com/exchange/services/2006/types">a:ErrorSchemaValidation</faultcode><faultstring xml:lang="en-US">The request failed schema validation: The element 'GetFolder' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages' has invalid child element 'body' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages'. List of possible elements expected: 'FolderShape' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages'.</faultstring><detail><e:ResponseCode xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">ErrorSchemaValidation</e:ResponseCode><e:Message xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">The request failed schema validation.</e:Message><t:MessageXml xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"><t:LineNumber>1</t:LineNumber><t:LinePosition>478</t:LinePosition><t:Violation>The element 'GetFolder' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages' has invalid child element 'body' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages'. List of possible elements expected: 'FolderShape' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages'.</t:Violation></t:MessageXml></detail></s:Fault></s:Body></s:Envelope>",
  74. "headers": {
  75. "cache-control": "private",
  76. "transfer-encoding": "chunked",
  77. "content-type": "text/xml; charset=utf-8",
  78. "server": "Microsoft-IIS/8.5",
  79. "request-id": "55604f74-3d8a-4c38-9013-f73b1bb46c8e",
  80. "x-targetbeserver": "exsrv2013.exch2013.local",
  81. "x-diaginfo": "EXSRV2013",
  82. "x-aspnet-version": "4.0.30319",
  83. "set-cookie": [
  84. "exchangecookie=80f1a4a9812e48e198b1aedd5647dbbb; expires=Fri, 02-Jun-2017 11:04:40 GMT; path=/; HttpOnly",
  85. "X-BackEndCookie=S-1-5-21-3055284827-1559891991-3414097450-500=u56Lnp2ejJqBz8bGmZvGnsnSzsnGndLLmc/J0p3LmcbSzpqcyczHx8+azsfJgYHJ0M3Qzc/Oyd/OzsXOy8XLz9++sg==; expires=Thu, 02-Jun-2016 11:14:40 GMT; path=/EWS; secure; HttpOnly"
  86. ],
  87. "persistent-auth": "true",
  88. "x-powered-by": "ASP.NET",
  89. "x-feserver": "EXSRV2013",
  90. "date": "Thu, 02 Jun 2016 11:04:39 GMT"
  91. },
  92. "request": {
  93. "uri": {
  94. "protocol": "https:",
  95. "slashes": true,
  96. "auth": null,
  97. "host": "192.168.50.192",
  98. "port": 443,
  99. "hostname": "192.168.50.192",
  100. "hash": null,
  101. "search": null,
  102. "query": null,
  103. "pathname": "/EWS/Exchange.asmx",
  104. "path": "/EWS/Exchange.asmx",
  105. "href": "https://192.168.50.192/EWS/Exchange.asmx"
  106. },
  107. "method": "post",
  108. "headers": {
  109. "Content-Type": "text/xml; charset=utf-8",
  110. "SOAPAction": ""http://schemas.microsoft.com/exchange/services/2006/messages/GetFolder"",
  111. "Connection": "keep-alive",
  112. "Authorization": "NTLM TlRMTVNTUAADAAAAGAAYAIAAAAAYABgAmAAAAAAAAABIAAAAOAA4AEgAAAAAAAAAgAAAAAAAAACwAAAABYKIogUBKAoAAAAPYQBkAG0AaQBuAGkAcwB0AHIAYQB0AG8AcgBAAGUAeABjAGgAMgAwADEAMwAuAGwAbwBjAGEAbAC6qN2n2xCgUgAAAAAAAAAAAAAAAAAAAAAF0f9pc5Kjl/rW+LUJhdYADmJV2IBc1Zw=",
  113. "content-length": 863
  114. }
  115. }
  116. },
  117. "body": "<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode xmlns:a="http://schemas.microsoft.com/exchange/services/2006/types">a:ErrorSchemaValidation</faultcode><faultstring xml:lang="en-US">The request failed schema validation: The element 'GetFolder' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages' has invalid child element 'body' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages'. List of possible elements expected: 'FolderShape' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages'.</faultstring><detail><e:ResponseCode xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">ErrorSchemaValidation</e:ResponseCode><e:Message xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">The request failed schema validation.</e:Message><t:MessageXml xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"><t:LineNumber>1</t:LineNumber><t:LinePosition>478</t:LinePosition><t:Violation>The element 'GetFolder' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages' has invalid child element 'body' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages'. List of possible elements expected: 'FolderShape' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages'.</t:Violation></t:MessageXml></detail></s:Fault></s:Body></s:Envelope>"
  118. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement