...
The TLSClientParameters are listed here and here. A new feature starting in CXF 2.0.5 is the disableCNcheck
attribute for this element. It defaults to false
, indicating that the hostname given in the HTTPS URL will be checked against the service's Common Name (CN) given in its certificate during SOAP client requests, and failing if there is a mismatch. If set to true
(not recommended for production use), such checks will be bypassed. That will allow you, for example, to use a URL such as localhost
during development.
...
First you need get the HTTPConduit from the Proxy object or Client, then you can set the HTTPClientPolicy, AuthorizationPolicy, ProxyAuthorizationPolicy, TLSClientParameters, and/or HttpBasicAuthSupplier.
Code Block | ||||
---|---|---|---|---|
| ||||
import org.apache.cxf.endpoint.Client; import org.apache.cxf.frontend.ClientProxy; import org.apache.cxf.transport.http.HTTPConduit; import org.apache.cxf.transports.http.configuration.HTTPClientPolicy; ... URL wsdl = getClass().getResource("wsdl/greeting.wsdl"); SOAPService service = new SOAPService(wsdl, serviceName); Greeter greeter = service.getPort(portName, Greeter.class); // Okay, are you sick of configuration files ? // This will show you how to configure the http conduit dynamically Client client = ClientProxy.getClient(poltim); HTTPConduit http = (HTTPConduit) client.getConduit(); HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy(); httpClientPolicy.setConnectionTimeout(36000); httpClientPolicy.setAllowChunking(false); httpClientPolicy.setReadTimeout(32000); http.setClient(httpClientPolicy); ... greeter.sayHi("Hello"); |
...