Hi,
follow problems we have: I call a werbservice (createtd by cxf) - in the
soap message, which will created, ist the xml-version tag missing. The
server declines the message ....
Tips are welcome to complete the soap message.
Thos code will called:
File truststoreFile = new File("zertifikate/key.store");
TLSClientParameters tlsParams = new TLSClientParameters();
tlsParams.setSecureSocketProtocol("SSLv3");
tlsParams.setDisableCNCheck(true);
try {
// Set Truststore
KeyStore truststore = KeyStore.getInstance("JKS");
truststore.load(new FileInputStream(truststoreFile),
truststorePassword.toCharArray());
TrustManagerFactory trustManagerFactory =
TrustManagerFactory.getInstance
(TrustManagerFactory.getDefaultAlgorithm());
trustManagerFactory.init(truststore);
TrustManager[] trustManager = trustManagerFactory.getTrustManagers();
tlsParams.setTrustManagers(trustManager);
KeyStore keystore = KeyStore.getInstance("JKS");
keystore.load(new FileInputStream(truststoreFile),
truststorePassword.toCharArray());
KeyManagerFactory keyManagerFactory =
KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
char[] passphrase = "changeit".toCharArray();
keyManagerFactory.init(keystore, passphrase);
KeyManager[] keyManagers = keyManagerFactory.getKeyManagers();
tlsParams.setKeyManagers(keyManagers);
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (java.security.cert.CertificateException e) {
e.printStackTrace();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (KeyStoreException e) {
e.printStackTrace();
}
JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
proxyFactory.setServiceClass(WsClass.class);
proxyFactory.setAddress(serverLocation);
proxyFactory.setEndpointName(new QName("http://www.ip.wsdl", "WsClass"));
// Set Filters
FiltersType filter = new FiltersType();
filter.getInclude().add("SSL_RSA_WITH_3DES_EDE_CBC_SHA");
filter.getInclude().add("SSL_RSA_EXPORT_WITH_RC4_40_MD4");
filter.getInclude().add("SSL_RSA_WITH_RC4_128_MD5");
filter.getInclude().add("SSL_RSA_WITH_DES_CBC_SHA");
filter.getInclude().add("SSL_RSA_WITH_RC4_128_SHA");
filter.getInclude().add("SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5");
filter.getInclude().add("SSL_RSA_WITH_NULL_SHA");
filter.getInclude().add("SSL_RSA_WITH_NULL_MD5");
filter.getInclude().add("SSL_NULL_WITH_NULL_NULL");
tlsParams.setCipherSuitesFilter(filter);
WsPortType port = (WsPortType) proxyFactory.create();
Client cxfClient = ClientProxy.getClient(port);
cxfClient.getInInterceptors().
HTTPConduit httpConduit = (HTTPConduit)cxfClient.getConduit();
httpConduit.setTlsClientParameters(tlsParams);
Return return1 = port.ping();
--
View this message in context:
http://www.nabble.com/xml-version-missing-in-soap-message-tp20184595p20184595.html
Sent from the cxf-user mailing list archive at Nabble.com.