• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

JAX-WS Consuming Exchange Web Services with java using glassfish, error authentication: Unauthorized

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 2.1.3.1-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();

((BindingProvider)port).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, uid);
((BindingProvider)port).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, password);

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);
Authenticator.setDefault(auth);

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.,

https://scooby-doo.org/EWS/Exchange.asmx

So I know my credentials are good. I’m really stumped javascript:emoticon(''); any “HELP” would be greatly appreciated.

Thanks,
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm working on EWS too (just starting), and I found this elsewhere. The authenticator requires basic authentication:

from Yale Exchange and Java article


Hope this helps!

-Jeremy
 
It's a beautiful day in this neighborhood - Fred Rogers. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic