Java client, SOAP and Exchange Web Services (EWS)
I'm working on creating a simple method that send SOAP request to EWS and it seems everything is OK. But when I run it I get error:
java.net.ProtocolException: Server redirected too many times (20)
Any ideas why I get this when I try to connect to https://my.exchange.server/ews/Services.开发者_Go百科wsdl ?
Note: my.exchange.server
is just a cover for my real URL
Make sure to enable Basic Authentication on EWS, sorry that's on the server side :). I am using EWS Java Api http://archive.msdn.microsoft.com/ewsjavaapi and it works fine even cross domains:
ExchangeService service = new ExchangeService();
ExchangeCredentials credentials = new WebCredentials("Administrator@yourdomain.com", "Password",
"yourdomain.com");
service.setCredentials(credentials);
service.setUrl(new URI("http://yourserver/EWS/Exchange.asmx"));
service.setPreAuthenticate(true);
BTW, I am also successfully reaching it with plain SOAP using SoapUI, but the key factor is enabled Basic Authentication, and URL is "http://yourserver/EWS/Exchange.asmx"
Good luck,
Boris
Herndon, VA
精彩评论