This answer came from the CXF user mailing list.
In the first example mentioned above, there was a typo. It has been updated to:
WebClient client = WebClient.create("http://books", "username", "password", "classpath:/config/https.xml");
The fourth argument may be null if the Spring configuration file (and therefore Spring) is not used.
So this worked for me:
private WebClient webClient; public RESTfulClient(String url, String username, String password) throws IllegalArgumentException { this.username = username; this.password = password; this.serviceURL = url; if (username == null || password == null || serviceURL == null) { String msg = "username, password and serviceURL MUST be defined."; log.error(msg); throw new IllegalArgumentException(msg); } webClient = WebClient.create(this.serviceURL, this.username, this.password, null);
sdoca source share