我遇到了一个问题我无法理解使用Classic ASP通过SOAP使用Exchange EWS帖子设置约会。
该代码约占50%的时间;这取决于我试图设置约会的交换用户。
使用下面的确切代码,我指定了一些用户&约会完美创造。当我指定其他用户时,它只返回401未经授权的错误。
我无法访问Exchange Server,因此我无法自行检查用户设置,但我被告知他们没有区别。我们的一个python开发人员能够使用NTLM身份验证使其工作。我不知道如何将其实现到下面的代码中,也找不到任何示例。
TARGETURL="https://mail.foo.com/ews/exchange.asmx"
USERNAME="testuser1@foo.com"
PASSWORD="abc123"
reqStr = ""
reqStr = reqStr & "<?xml version='1.0' encoding='utf-8'?>"
reqStr = reqStr & "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'"
reqStr = reqStr & " xmlns:m='http://schemas.microsoft.com/exchange/services/2006/messages'"
reqStr = reqStr & " xmlns:t='http://schemas.microsoft.com/exchange/services/2006/types'"
reqStr = reqStr & " xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>"
reqStr = reqStr & " <soap:Header>"
reqStr = reqStr & " <t:RequestServerVersion Version='Exchange2007_SP1' />"
reqStr = reqStr & " <t:TimeZoneContext>"
reqStr = reqStr & " <t:TimeZoneDefinition Id='Eastern Standard Time' />"
reqStr = reqStr & " </t:TimeZoneContext>"
reqStr = reqStr & " </soap:Header>"
reqStr = reqStr & " <soap:Body>"
reqStr = reqStr & " <m:CreateItem SendMeetingInvitations='SendToNone'>"
reqStr = reqStr & " <m:Items>"
reqStr = reqStr & " <t:CalendarItem>"
reqStr = reqStr & " <t:Subject>ABC Company Appointment</t:Subject>"
reqStr = reqStr & " <t:Body BodyType='HTML'>Speak to discuss pricing</t:Body>"
reqStr = reqStr & " <t:Start>2017-04-05T15:20:00.000Z</t:Start>"
reqStr = reqStr & " <t:End>2017-04-05T16:20:00.000Z</t:End>"
reqStr = reqStr & " <t:Location>Conference Room 1</t:Location>"
reqStr = reqStr & " <t:MeetingTimeZone TimeZoneName='Eastern Standard Time' />"
reqStr = reqStr & " </t:CalendarItem>"
reqStr = reqStr & " </m:Items>"
reqStr = reqStr & " </m:CreateItem>"
reqStr = reqStr & " </soap:Body>"
reqStr = reqStr & "</soap:Envelope>"
'Perform the actual post
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 reqStr