Hello all,
This is a beginner question.
I've been using the instructions here:
http://jbws.dyndns.org/mediawiki/index.php/JAX-WS_User_Guide
I've successfully created a POJO web service and published it as a
servlet in JBoss 4.2.2. I also created a user / role in the jbossws
security realm and restricted access to my web service using web.xml.
===> The problem is: the way I've configured things, JBoss asks me for a
password even when trying to access the WSDL. If I download the
published WSDL with Firefox and save it locally, my test client can read
it and then accesses the web services successfully (using the
BindingProvider properties). I would like to retrieve the WSDL from the
server as follows:
URL wsdlURL = new URL(
"file:///path/to/MyTestService.wsdl"); //<==== THIS WORKS
// URL wsdlURL = new URL(
//
"http://localhost:8080/jbossws/services/MyTestService?wsdl");
// <==== THE ABOVE FAILS BECAUSE IT REQUIRES HTTP BASIC AUTH ====>
QName serviceName = ...;
Service s = Service.create(wsdlURL, serviceName);
MyService ms = (MyService) s.getPort(MyService.class);
BindingProvider bp = (BindingProvider) rs;
bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY,
"xxx");
bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY,
"yyy");