I'm running JBoss 4.2 with the latest jbossws libraries. I have a simple web service running and I wanted to secure it with HTTP Basic Authentication (actually anything would do but that seemed the simplest). I followed the steps in http://jbws.dyndns.org/mediawiki/index.php?title=Authentication, but now my client gets an error when creating the service (this is before setting the username and password using the BindingProvider -- but you need the service object on which to do that -- perhaps a chicken/egg problem?)
service = Service.create(wsdlURL, new QName(...));
[exec] org.jboss.ws.metadata.wsdl.WSDLException: Cannot parse wsdlLocation: http://localhost:8080/resonantProcessLibrary?wsdl [exec] at org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.getDocument(WSDLDefinitionsFactory.java:183) [exec] at org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:108) [exec] at org.jboss.ws.metadata.umdm.ServiceMetaData.getWsdlDefinitions(ServiceMetaData.java:321) [exec] at org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder.buildMetaData(JAXWSClientMetaDataBuilder.java:85) [exec] at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.<init>(ServiceDelegateImpl.java:132) [exec] at org.jboss.ws.core.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:63) [exec] at javax.xml.ws.Service.<init>(Service.java:82) [exec] at javax.xml.ws.Service.create(Service.java:334) [exec] at com.resonant.processlibrary.api.RemoteDocumentRepository.<init>(RemoteDocumentRepository.java:77)
When I try to access the wsdl in a browser using the wsdlURL I get the username/password challenge and after entering the correct credentials I get the WSDL so things seems to be working on the server end. Just cannot get the client to connect. It sort of seems like the username/password are needed to get the WSDL to seup the service but there is no way to provide the username/password until the service is setup. But that's what the example says to do and my code is following it exactly.
One other tidbit. When I use my .Net client to access the webservice I get a 401 (unauthorized) as expected, but when I modify the .NET client to add the credential I then get a 505 (HTTP protocal not supported).