Hi, I'am trying to use Axis 2 to call MSSQL Report Server Web Services. Authentication is done with IIS and NTLM. I found a lot of code sample but nothing work, I always have a 401 : Acces Denied. Does anyone succed using NTLM with Axis 2 ? I also tried to use a proxy parameter in struts2.xml but it doesn't work. Here is my code:
ReportingServiceStub stub = new ReportingServiceStub("http://127.0.0.1/ReportServer/ReportService.asmx"); HttpTransportProperties.Authenticator auth = new HttpTransportProperties.Authenticator(); auth.setUsername("user"); auth.setPassword("password"); auth.setHost("server.fr.domain.com"); auth.setDomain("domain"); auth.setPreemptiveAuthentication(false); List authPrefs = new ArrayList(1); authPrefs.add(AuthPolicy.NTLM); auth.setAuthSchemes(authPrefs); stub._getServiceClient().getOptions().setProperty(HTTPConstants.AUTHENTICATE, auth); com.microsoft.schemas.sqlserver.reporting.reportingservices.ReportingServiceStub.GetReportDefinition getReportDefinition602= (com.microsoft.schemas.sqlserver.reporting.reportingservices.ReportingServiceStub.GetReportDefinition)getTestObject(com.microsoft.schemas.sqlserver.reporting.reportingservices.ReportingServiceStub.GetReportDefinition.class); getReportDefinition602.setReport("/Galaxy/utilisateur"); assertNotNull(stub.GetReportDefinition(getReportDefinition602)); Thanks