Have a CXF 2.1.4 ssl service running in Tomcat 6 and have a CXF ssl client.
The service and client run fine on http but when using https all calls with
user defined type parameters are received as null at the service, calls
with no or only simple type parameters work fine. Works the same with Spring
based and Java API based clients. AND their are no errors logged anywhere
client or server side. Have tried everything I could find on this group and
blogs for days to figure it out. If anyone has any ideas I would appreciate
it, in the mean time I will be converting my service to Axis2. Here is my
Java API client if anyone is interested:
public static void main(String[] args) {
String truststorePath = "C:/TrustStore/truststore.jks";
String url =
"https://localhost/TestTomcatCXFSSLBasicAuth/webservices/hw";
String truststorePassword = "changeit";
try {
//Create the service proxy (stub)
JaxWsProxyFactoryBean factory = new
JaxWsProxyFactoryBean();
factory.getInInterceptors().add(new
LoggingInInterceptor());
factory.getOutInterceptors().add(new
LoggingOutInterceptor());
factory.setServiceClass(IHelloWorld.class);
factory.setAddress(url);
IHelloWorld client = (IHelloWorld) factory.create();
//Setup the conduit
//System.setProperty("javax.net.ssl.trustStore",
truststorePath);
//System.setProperty("javax.net.ssl.trustStorePassword", "changeit");
Client proxy = ClientProxy.getClient(client);
HTTPConduit conduit = (HTTPConduit) proxy.getConduit();
TLSClientParameters tlsParams = new
TLSClientParameters();
// turn off the use of chunking inside HTTPConduit.
HTTPClientPolicy httpClientPolicy = new
HTTPClientPolicy();
httpClientPolicy.setAllowChunking(false);
conduit.setClient(httpClientPolicy);
// disabling host name check
tlsParams.setDisableCNCheck(true);
// setup truststore - AGAIN!
KeyStore keyStore = KeyStore.getInstance("JKS");
String trustpass = truststorePassword;
File truststore = new File(truststorePath);
keyStore.load(new FileInputStream(truststore),
trustpass.toCharArray());
// setting trust manager(s)
TrustManagerFactory trustFactory =
TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
trustFactory.init(keyStore);
TrustManager[] tm = trustFactory.getTrustManagers();
tlsParams.setTrustManagers(tm);
//
FiltersType filter = new FiltersType();
filter.getInclude().add(".*_EXPORT_.*");
filter.getInclude().add(".*_EXPORT1024_.*");
filter.getInclude().add(".*_WITH_DES_.*");
filter.getInclude().add(".*_WITH_NULL_.*");
filter.getExclude().add(".*_DH_anon_.*");
tlsParams.setCipherSuitesFilter(filter);
// setting parameters
conduit.setTlsClientParameters(tlsParams);
BindingProvider bindingProvider = (BindingProvider)
client;
bindingProvider.getRequestContext().put(BindingProvider.USERNAME_PROPERTY,
"admin");
bindingProvider.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY,
"admin");
System.out.println(client.helloWorld("World")); //THIS
WORKS FINE
//
TestDto dto = new TestDto();
dto.setAge(33);
dto.setName("Bub");
System.out.println("main: sending " + dto);
client.loadDto(dto); //THIS ONE NO WORKY
} catch (Exception e) {
e.printStackTrace();
}
}
Rick Holland
--
View this message in context:
http://www.nabble.com/CXF-SSL-Client-sending-null-UDTs-tp22126054p22126054.html
Sent from the cxf-user mailing list archive at Nabble.com.