users@wadl.java.net

Re: Basic Authentication??

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Thu, 31 Jul 2008 14:29:11 -0400

Try adding the following somewhere in your code before you use the
generated Java classes:

final String username ="...";
final String password ="...";
Authenticator.setDefault(new Authenticator() {
   protected PasswordAuthentication getPasswordAuthentication() {
     return new PasswordAuthentication (username,
password.toCharArray());
   }
});

HTH,
Marc.

On Jul 31, 2008, at 2:10 PM, Jorge L Williams wrote:

>
> I'm trying to setup a WADL for a site that uses Basic
> Authentication. With authentication turned off things work great,
> but with it on I get a weird exception...
>
> javax.xml.bind.UnmarshalException:
>
> with linked exception:
>
> org.xml.sax.SAXParseException: White spaces are required between
> publicId and systemId
>
> Has anyone else tried to use Basic Authentication? Are there any
> work arounds???
>
> Thanks
>
> jOrGe W.

---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.