[JAX-WS] Erreur "Failed to access the WSDL"
Bonjour à tous,
je dois me connecter à un service web donc écrire un client java.
J'ai donc utiliser l'outil wsimport pour générer les classes pour me connecter à ce service.
Le problème c'est que ce service demande une authentification avec Login/mot de passe, j'ai donc tester depuis le navigateur et récupérer en local le wsdl.
J'ai donc eu une classe (JAX-WS) tel quelle
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
private final static URL CLIENTPULLSERVICE_WSDL_LOCATION;
private final static Logger logger = Logger.getLogger(XXXX.class.getName());
static {
URL url = null;
try {
URL baseUrl;
baseUrl = pkg.ClientPullService.class.getResource(".");
url = new URL(baseUrl, "https://XXXXXXXXXX?wsdl");
} catch (MalformedURLException e) {
logger.warning("Failed to create URL for the wsdl Location: 'XXXXXXXXXX?wsdl', retrying as a local file");
logger.warning(e.getMessage());
}
CLIENTPULLSERVICE_WSDL_LOCATION = url;
}
public ClientPullService(URL wsdlLocation, QName serviceName) {
super(wsdlLocation, serviceName);
}
public ClientPullService() {
super(CLIENTPULLSERVICE_WSDL_LOCATION, new QName("XXXXXXXXXXX", "clientPullService"));
} |
Le problème c'est quand j'essaye d'utiliser cette classe par
Code:
ClientPullService clientPullService = new ClientPullService();
je reçois le message d'erreur suivant
Code:
1 2
| javax.xml.ws.WebServiceException: Failed to access the WSDL at: XXXXX?wsdl. It failed with:
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target. |
Je comprends bien car il ne peut pas récupérer le wsdl sans s'authentifier correctement mais comment rajouter ce code ?
Merci car je suis perdu dans Google...