AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 15.12.2010, 17:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,640 / 848 (80) +++++++
Регистрация: 28.10.2006
daxdilip: [Updated] Code to read email using EWS (Exchange Web Services)
Источник: http://daxdilip.blogspot.com/2010/12...using-ews.html
==============

Thanks for all my blog readers as I got an overwhelming response for this post asking me for the code to connect using EWS and read email from Exchange Server

For starters, this is the Part 1 which gives a theoretical view of using EWS to read email without having Outlook Client on your AOS
http://daxdilip.blogspot.com/2010/12...-download.html

This is all the code which does the job:

a. Declaration







b. Logic for reading the email for a particular email address and subject and downloading the attachment















As you have seen the code above is very self-explanatory as it calls the Exchange Service proxy to do a FindItems for the mailbox folder (Inbox) and for a particular subject.

The next part in code is where it loops through the item collection and if it finds an attachment for the message item, it will download the attachment to the path supplied.

Limitations:

a. I tried to directly invoke the code from AX by adding the Exchange Service Assembly to the Resources node in AOT, but I'm unable to marshall the complex types and generics between X++ and .Net, Also the class ContainsSubstring is an abstract implementation in .Net which I'm unable to get a handle via X++, so I had to write a custom .Net wrapper and then call this from X++.

b. The X++ code which invokes my custom .Net assembly works fine without any issues if it's run via a job or class or menu item but as soon as I put it in a batch it doesn't work. It just fails without any error log.

If anyone has any ideas or have invoked custom .Net assemblies via a batch, can you throw some light


Источник: http://daxdilip.blogspot.com/2010/12...using-ews.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
dynamics-ax: Blog spotlight: Dilip's AX & Exchange Web Services Blog bot DAX Blogs 0 13.12.2010 01:14
daxdilip: How to Read email and download attachment from AX (AOS) without Installing Outlook Client and using EWS Exchange Web Services Blog bot DAX Blogs 0 11.12.2010 13:11
daxdilip: Fiddler - Good tool to check EP web page, custom websites, performance and AIF Web services Blog bot DAX Blogs 0 04.12.2010 14:11
Inside Dynamics AX 4.0: The Web Framework Blog bot DAX Blogs 0 25.10.2007 03:04

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 01:03.