I'm trying to consume exchange web services with java using glassfish. The client is written using Netbeans 6.7.1 and I’m receiving the following error:
JAX-WS RI 220.127.116.11-hudson-749-SNAPSHOT: Stub for https://scooby-doo.org/EWS/Exchange.asmx
Exception in thread "main" com.sun.xml.ws.client.ClientTransportException: request requires HTTP authentication: Unauthorized
I tried putting the username and password in the SOAP message using:
String uid = domain + "\\" + username;
ExchangeServicePortType port = exchangeWebService.getExchangeWebPort();
But it still fails with the ‘noted above’ error message.
Then I tried using an “Authenticator”. From understanding I do not have to associate it with web service, since the same object is used for the whole JVM, correct?
MyAuthenticator auth = new MyAuthenticator(username, uid);
But again, it still fails with the same ‘noted above’ message.
Additionally, I’m able to access the web service via the browser i.e.,
'); any “HELP” would be greatly appreciated.