Tag: exchangewebservices

如何通过java Web服务客户端连接Exchange Web服务?

我正在使用JWebService框架连接我的Exchange Server 2007.由于它是付费版本,我正在寻找一些像JWebService这样的开源。 任何人都可以建议一个免费的替代Java API吗? 提前致谢!

使用Exchange Web服务Java API下载附件?

我正在编写一个Java应用程序来使用Exchange Web服务下载电子邮件。 我正在使用Microsoft的ewsjava API来执行此操作。 我可以获取电子邮件标题。 但是,我无法使用此API下载电子邮件附件。 以下是代码段。 FolderId folderId = new FolderId(WellKnownFolderName.Inbox, “mailbox@example.com”); findResults = service.findItems(folderId, view); for(Item item : findResults.getItems()) { if (item.getHasAttachments()) { AttachmentCollection attachmentsCol = item.getAttachments(); System.out.println(attachmentsCol.getCount()); // This is printing zero all the time. My message has one attachment. for (int i = 0; i < attachmentsCol.getCount(); i++) { FileAttachment attachment […]

通过客户端存根访问WSDL时Java InaccessibleWSDLException

我正在尝试为Exchange Web服务编写自定义Java客户端。 我已经使用wsimport工具生成了客户端存根,如EWS的Services.wsdl文件中所述。 现在我编写了使用这些存根的代码。 我得到以下exception: Exception in thread “main” com.sun.xml.internal.ws.wsdl.parser.InaccessibleWSDLException: 2 counts of InaccessibleWSDLException. java.io.IOException: Got Server returned HTTP response code: 401 for URL: https://host.domain.com/ews/Services.wsdl while opening stream from https://host.domain.com/ews/Services.wsdl java.io.IOException: Got Server returned HTTP response code: 401 for URL: https://host.domain.com/ews/Services.wsdl?wsdl while opening stream from https://host.domain.com/ews/Services.wsdl?wsdl at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.tryWithMex(Unknown Source) at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(Unknown Source) at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(Unknown Source) […]

使用Core JAVA中的ews-java-api-2.0.jar连接到Office365 Exchange Server

我使用的是ews-java-api-2.0.jar,连接到office365,下面是示例代码: package javaapplication6; import java.net.URI; import microsoft.exchange.webservices.data.autodiscover.IAutodiscoverRedirectionUrl; import microsoft.exchange.webservices.data.credential.ExchangeCredentials; import microsoft.exchange.webservices.data.core.ExchangeService; import microsoft.exchange.webservices.data.core.enumeration.property.WellKnownFolderName; import microsoft.exchange.webservices.data.core.service.folder.Folder; import microsoft.exchange.webservices.data.credential.WebCredentials; public class JavaApplication6 { public static class RedirectionUrlCallback implements IAutodiscoverRedirectionUrl { public boolean autodiscoverRedirectionUrlValidationCallback(String redirectionUrl) { return redirectionUrl.toLowerCase().startsWith(“https://”); } } public static ExchangeService connectViaExchangeManually(String email, String password) throws Exception { ExchangeService service = new ExchangeService(); ExchangeCredentials credentials = […]

在Android上交换Web服务,错误

我正在尝试在Android上实现和使用Exchange Web服务。 我找到了这篇文章,我通过安装Microsoft的EWS API JAVA以同样的方式: http://stackoverflow.com/questions/7476055/use-exchange-web-services-on-android 我编写并执行了一个发送消息的简单示例。 但我得到了这个错误: java.lang.VerifyError: microsoft.exchange.webservices.data.ExchangeServiceBase 愿有人帮帮我吗? 有人可能分享任何样本吗? 谢谢! 这是样本: package com.example.ewsandroid; import java.net.URI; import java.util.Locale; import microsoft.exchange.webservices.data.EmailMessage; import microsoft.exchange.webservices.data.ExchangeService; import microsoft.exchange.webservices.data.MessageBody; import microsoft.exchange.webservices.data.WebCredentials; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.Button; public class MainActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final Button mButton = (Button) […]

Exchange Web服务Java APi + RESTful推送通知侦听器

我试图让我的听众使用ews java API,但我不能..我希望你能帮助我! 我已经完成了以下步骤: 1)连接到交换Web服务 ExchangeService newService = new ExchangeService(ExchangeVersion.Exchange2010_SP2); newService.setUrl(“https://myurl/ews/Exchange.asmx”); ExchangeCredentials credentials = new WebCredentials(“user”,”password”); newService.setCredentials(credentials); 2)然后订阅推送通知: @Override public PushSubscription subscribeToPushNotifications(){ URI callback = null; PushSubscription pushSubscription = null; try{ logger.info(“Subscribing to push notifications.. Endpoint Listener URI = ” + config.getNotificationListenerURI()); callback = new URI(config.getNotificationListenerURI()); pushSubscription = service.subscribeToPushNotifications( getFoldersForSubscription(), callback , 5, null, EventType.NewMail, […]