1 Reply Latest reply on Feb 9, 2015 10:00 AM by Sueleyman Vurucu

    HTTP authentification from BackingBean

    Sueleyman Vurucu Expert

      Hi guys,

       

      I try to do an authenticaed  http ws-request  from a CDI bean. 

      For that I posted this thread Webservice Authentifaction from jsf app. Beacause I thought there is  problem with the Jax-WS implementation.

           

           Authenticator.setDefault(new NavisionAuthenticator("user", "pass"));

           URL url = ...

            // read text returned by server

           BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));

       

       

          String line;

          while ((line = in.readLine()) != null) {

              logger.debug(line);

          }

          in.close();

      In SE environment I can do that request but from my backingbean I get an auttenfication error ( http 401) did I miss something?