EWS
-
שבת 14 אפריל 2012 08:10
היי ...
אני עכשיו מתחילה לקנפג תקשורת בין אפליקציה כלשהי לexchage , אני מעוניינת לשלוח ולכתוב רק הודעות soap ללא כל שורת קוד , האם זה אפשרי?
כי בMSDN ראיתי שהם מצריכים לכתוב את השורות קוד הבאות :
// Connect to Exchange Web Services as user1 at contoso.com. ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1); service.Credentials = new WebCredentials("user1@contoso.com", "password "); service.AutodiscoverUrl("user1@contoso.com"); // Create the e-mail message, set its properties, and send it to user2@contoso.com, saving a copy to the Sent Items folder. EmailMessage message = new EmailMessage(service);
האם אפשר לכתוב אותן דרך הודעת ה soap, אם כן איך?
בנוסף האם צריכים להגדיר הרשאות ב IIS או להתקין dll כלשהו שקשור לשימוש ב EWS ?
תודה :)
כל התגובות
-
יום ראשון 15 אפריל 2012 09:32
שלום,
שורות הקוד שאת מתארת הם בסך הכל API שעוטף הודעות SOAP.
כלומר, אם תפתחי fiddler תוכלי לראות את ה- soap עצמו ולשלוח אותו לשרת.
יש צורך מיוחד שאת רוצה לעבוד ישירות עם ה- soap?
אסף
MCPD
MCTS - TFS 2010
My Blog: http://benjaminet.wordpress.com- הוצע כתשובה על-ידי tetitu יום שני 16 אפריל 2012 16:46
- סומן כתשובה על-ידי Eran SharvitMicrosoft Contingent Staff, Owner יום שלישי 01 מאי 2012 13:52
-
יום ראשון 15 אפריל 2012 09:34
Exchange 2007 היא הגרסה הראשונה שתומכת ב WEBSERVICE (עד כמה שידוע לי)
בכדי לקרוא ל WEBSERVICE את לא צריכה להתקין כלום על השרת (איפה שאת מריצה את הקוד).
אבל על גבי שרת ה EXCHANGE צריך לאפשר קריאות ל webservice את יכולה לגלוש בדפדפן את ה WEBSERVICE בכדי לראות את זה עובד.
את יכולה לקרוא על זה ב MSDN
http://msdn.microsoft.com/en-us/library/bb408417(v=exchg.80).aspx
על מנת להקל על הפיתוח (במידה ואין לך גישה ל WEBSERVICE)
- סומן כתשובה על-ידי Eran SharvitMicrosoft Contingent Staff, Owner יום שלישי 01 מאי 2012 13:52
-
יום ראשון 15 אפריל 2012 10:09
היי אסף
המערכת שאני עובדת איתה יכולה לקרוא רק הודעות מסוג XML ולכן אני צריכה לכתוב SOAP בלבד ע"מ להשתמש בשירותים שה EWS מציע לי בכל אופן בכל מקום שכתוב בוא שורות קוד מצויין להתחיל עם השורות קוד שכתבתי האם אני חייבת אכן להשתמש בשורות אלו ע"מ לשלוח הודעות מייל , האם אני יכולה להמיר את זה ל SOAP format? במידה וזה אפשרי איך?
// Connect to Exchange Web Services as user1 at contoso.com. ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1); service.Credentials = new WebCredentials("user1@contoso.com", "password "); service.AutodiscoverUrl("user1@contoso.com"); // Create the e-mail message, set its properties, and send it to user2@contoso.com, saving a copy to the Sent Items folder. EmailMessage message = new EmailMessage(service);
-
יום שני 16 אפריל 2012 06:53
כפי שאמרו לך.
תכתבי את הקוד שאת צריכה ב .net
תפעילי את ה FIDDLER ואז תוכלי לראות את ה XML שמיוצר ע"י ה .net
-
יום שלישי 17 אפריל 2012 15:58בעלים
הי אורטל,
נשמח אם תעדכני אותנו בסטטוס השאלה.
תודה,
צוות הפורומים.
מיקרוסופט מציעה שירות זה ללא תשלום, למטרת סיוע למשתמשים והעשרת הידע הקשור בטכנולוגיות ובמוצרים של מיקרוסופט. תוכן זה מתפרסם כפי שהוא והוא אינו מעיד על כל אחריות מצד מיקרוסופט.
-
יום חמישי 03 מאי 2012 14:47
היי
לפי בדיקה שהרצתי ת שורות אלה לא ייכתבו בתוך ה soap
אלא מחוצה לו ז"א אכן חייב להכניס הרשאות
עקבו אחרי הקוד שצירפתי זהו קוד הרשום ב VB
ושולח מייל ל exchange
Option Explicit ' --------------------------------------------------------- ' CONFIGURATION - change as needed ' --------------------------------------------------------- Const TARGETURL = "https://cmexchange/ews/exchange.asmx" Const USERNAME = "rdmobile\ortal.lagziel" Const PASSWORD = "1234.com" Sub SendMessageEWS() Dim SOAP SOAP = CreateMessageSOAP() MsgBox "bvbvbvb" ' Send the SOAP request, and return the response Dim oXMLHTTP, oXml Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP") Set oXml = CreateObject("MSXML2.DOMDocument") ' Send the request oXMLHTTP.Open "POST", TARGETURL, False, USERNAME, PASSWORD oXMLHTTP.setRequestHeader "Content-Type", "text/xml" oXMLHTTP.send SOAP If oXMLHTTP.Status = "200" Then ' Get response If oXml.LoadXML(oXMLHTTP.ResponseText) Then ' Success Debug.Print oXml.XML End If Else Debug.Print oXMLHTTP.ResponseText MsgBox "Response status: " & oXMLHTTP.Status End If End Sub Function CreateMessageSOAP() ' Normally this is done by using the DOM, but this is easier for a demo... Dim SOAPMsg MsgBox "in snend messagesews" SOAPMsg = SOAPMsg & "<?xml version='1.0' encoding='utf-8'?>" SOAPMsg = SOAPMsg & " <soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:t='http://schemas.microsoft.com/exchange/services/2006/types' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>" SOAPMsg = SOAPMsg & " <soap:Body>" SOAPMsg = SOAPMsg & " <CreateItem MessageDisposition='SendAndSaveCopy' xmlns='http://schemas.microsoft.com/exchange/services/2006/messages'>" SOAPMsg = SOAPMsg & " <SavedItemFolderId>" SOAPMsg = SOAPMsg & " <t:DistinguishedFolderId Id='sentitems' />" SOAPMsg = SOAPMsg & " </SavedItemFolderId>" SOAPMsg = SOAPMsg & " <Items>" SOAPMsg = SOAPMsg & " <t:Message>" SOAPMsg = SOAPMsg & " <t:Subject>Exchange Web Service E-Mail Test</t:Subject>" ' For HTML message body SOAPMsg = SOAPMsg & " <t:Body BodyType='HTML'><![CDATA[<h1>Test html bodyuiuityytytyt</h1>]]></t:Body>" ' For text message body ' SOAPMsg = SOAPMsg & " <t:Body BodyType='Text'><![CDATA[Test text bodyiuiuiuiuiuiuiuiuiui]]></t:Body>" SOAPMsg = SOAPMsg & " <t:ToRecipients>" SOAPMsg = SOAPMsg & " <t:Mailbox>" SOAPMsg = SOAPMsg & " <t:EmailAddress>ortal.lagziel@rdmobile.local</t:EmailAddress>" SOAPMsg = SOAPMsg & " </t:Mailbox>" SOAPMsg = SOAPMsg & " </t:ToRecipients>" SOAPMsg = SOAPMsg & " </t:Message>" SOAPMsg = SOAPMsg & " </Items>" SOAPMsg = SOAPMsg & " </CreateItem>" SOAPMsg = SOAPMsg & " </soap:Body>" SOAPMsg = SOAPMsg & " </soap:Envelope>" CreateMessageSOAP = SOAPMsg MsgBox "in snend messagesews" End Function call SendMessageEWS
- נערך על-ידי Eran SharvitMicrosoft Contingent Staff, Owner יום ראשון 06 מאי 2012 08:24 enhance