Exchange Web 服务 API 1.0 错误
当我尝试连接到 Microsoft Online 上的 Exchange 服务器时,出现以下错误。我不知道如何访问底层 XML,并且想知道是否会导致此错误,因为交换只是提供标准 OWA 登录表单,而不是 EWS API 期望的 XML 响应。我怎样才能检查这个?
这是我的代码最后一行引发的错误: '>'是一个意想不到的令牌。预期的标记是 '"' 或 '''。第 7 行,位置 62。
这是我的代码:
Dim ews As New ExchangeService
ews.Credentials = New WebCredentials("[email protected]", "mypassword")
ews.Url = New Uri("https://mysubdomain.microsoftonline.com")
'send a test message
Dim message As New EmailMessage(ews)
message.Subject = "Hello World!"
message.Body = "This is a test message"
message.ToRecipients.Add("[email protected]")
message.SendAndSaveCopy()
I'm getting the following error when trying to connect to my exchange server at Microsoft Online. I couldn't see how to get access to the underlying XML and I wondered if this error is caused because exchange is just serving the standard OWA login form, rather than an XML response that the EWS API expects. How can I check this?
This is the error, thrown on the the last line of my code:
'>' is an unexpected token. The expected token is '"' or '''. Line 7, position 62.
This is my code:
Dim ews As New ExchangeService
ews.Credentials = New WebCredentials("[email protected]", "mypassword")
ews.Url = New Uri("https://mysubdomain.microsoftonline.com")
'send a test message
Dim message As New EmailMessage(ews)
message.Subject = "Hello World!"
message.Body = "This is a test message"
message.ToRecipients.Add("[email protected]")
message.SendAndSaveCopy()
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通过将 Uri 更改为以下内容来修复此问题: https://servername/ews/Exchange.asmx
I fixed this by changing the Uri to the following: https://servername/ews/Exchange.asmx